Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Technical Support » Other » PHP issue
Re: PHP issue [message #439853 is a reply to message #438943] Sun, 21 November 2010 15:25 Go to previous messageGo to previous message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma:
General (5 Stars)
In your query your checking if uid is equal to something, but then you try to echo id, do you have both a uid and id field in that table?


You might want to do something like this to check what results your actually getting back;

$query = mysql_query("SELECT * FROM table"); // Query here
echo "Query returned ".mysql_num_rows($query)." results;<br/><pre>"; // Output number of results
while ( $result = mysql_fetch_assoc($query) ) // Iterate through each result row
{
  print_r($result); // Dump contents of current result row
  echo "<br/><br/>"; // Leave a gap between each result row
}
echo "</pre><br/>End of results<br/>";
mysql_data_seek($query,0); // Reset results pointer



FYI: The mysql_data_seek() call at the end just tells PHP to set the results pointer back to the first row so you can still process the results in the code which follows that block of code.


http://steamsignature.com/card/1/76561197975867233.png

[Updated on: Sun, 21 November 2010 15:28]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GameSpy
Next Topic: Generals... AGAIN
Goto Forum:
  


Current Time: Fri Nov 22 19:28:08 MST 2024

Total time taken to generate the page: 0.01130 seconds