newbie questions

From: Date: Thu, 31 Aug 2000 22:48:28 +0000
Subject: newbie questions
Groups: php.general 
Request: Send a blank email to php-general+get-14690@lists.php.net to get a copy of this message
I did a mysql_query put the answer into $result. I checked for errors. There aren't any. (When I do this same query from telnet it returns the expected nonempty data.) In my program then want to access the data from this dataset, so I do the following: if(!($r=mysql_fetch_array($result))) { $err=mysql_error($db); print "Error $err fetch array from user_list<br>.\n"; } else { #process this data..... } It prints "Error fetch array....." and there is no error string and I have absolutely no idea what went wrong, especially since in this case I know for a fact that there SHOULD be a valid data set pointed to. Does this indicate that everything was OK and I just had null data in my original $result or what? OK and another question: The following query causes PARSE errors when I feed it to mysql_query. I have gotten other queries kind of like it to work. Do I have to encode it or escape it or something? or would it just mess up if $uid was undefined? Here is the line from the code: $sql = "SELECT h_count from pagehits where u_id=$uid AND h_pagename='$page'"; The variable $uid is supposed to be a numeric, and $page is always just a string of letters. Thanks for helping a newbie. for how to maximize your time on line go to http://theroute.to/easymoney ______________________________________________________ Get Paid... With Your Free Email at http://www.zwallet.com/index.html?user=platypus

« previous php.general (#14690) next »