Posted: Sat Oct 22, 2005 1:32 pm
can you write it?? I am not very good at messing with actions in IF-stuff
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
if($num != FALSE)Code: Select all
if ($num < 1)Maybe his db connection string is flatlined.Jenk wrote:mysql_num_rows() only returns FALSE if it couldn't connect to the database, or similar such errors.
For that circumstance, the if challenge should read (in my opinion):EDIT: You should also read up on security, in particular, SQL Injection prevention.Code: Select all
if ($num < 1)
After your mysql_connect() and mysql_select_db() put this to see if the error is with your db connection:Ralle wrote:but $num ALWAYS output NOTHING.. I can't understand it.. $num is not less than 1, it's less than nothing at all.. know how to fix it???
Code: Select all
$link = mysql_connect("localhost", $username, $password) or die('Could not connect: ' . mysql_error());
mysql_select_db("yourDB") or die('Could not select database': . mysql_error());Code: Select all
=<Code: Select all
<=Code: Select all
$idCode: Select all
'$id'Sweet! Where were those "bugs" at?Ralle wrote:I found 2 bugs that made your telling work.
should beCode: Select all
=<andCode: Select all
<=should beCode: Select all
$idit works perfect now!Code: Select all
'$id'
Just around the script. It's cool now..dallasx wrote:Sweet! Where were those "bugs" at?Ralle wrote:I found 2 bugs that made your telling work.
should beCode: Select all
=<andCode: Select all
<=should beCode: Select all
$idit works perfect now!Code: Select all
'$id'