Welcome Guest, Not a member yet? Register   Sign In
mysql php confusion
#1

[eluser]new_igniter[/eluser]
I am completely baffled by something that seems so simple. If you have a minute, can you look at this below? On the someFunction call below, the data never is there. So I have been having to run the same query twice to get the data for one, and the same data for another. Does mysql_fetch_array() use the data and then throw it away as it goes? I dont understand what I could not just use $result again and again.

Code:
$query = "select * from someTable";
$result = mysql_query($query);
  
while($row = mysql_fetch_array($result))
{
$idRowID = $row['twibsID'];
$idRowResultString .= "$idRowID','";
}

someFunction($result);

function someFunction ($result)
{
while($row = mysql_fetch_array($result))
{
do some stuff...
}
}


Messages In This Thread
mysql php confusion - by El Forum - 05-14-2009, 08:52 PM
mysql php confusion - by El Forum - 05-15-2009, 02:17 AM
mysql php confusion - by El Forum - 05-15-2009, 03:00 AM
mysql php confusion - by El Forum - 05-15-2009, 03:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB