Re: How do I test on number of fields ?

From: Date: Tue, 20 Mar 2001 14:41:44 +0000
Subject: Re: How do I test on number of fields ?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7643@lists.php.net to get a copy of this message
On Mon, Mar 19, 2001 at 10:06:52PM -0800, Toke Herkild wrote: > I've written this login rutine > > But that doesn't work... I've tried to use mysql_num_rows too but I still > get : > <b>Warning</b>: Supplied argument is not a valid MySQL result resource in > <b>g://web/herkild/html/loginout.php</b> on line <b>113</b><br> > > if ($ACTION == 'Login') { > $query = "SELECT user.ID FROM user WHERE "; > $query .= "user.brugerID = $LoginBrugerID AND "; > $query .= "user.kodeord = $LoginKodeord;"; > > $mysql_result = mysql_query($query, $mysql_link); > > (line 113 >>) if ($row = mysql_fetch_row($mysql_result)){ > setcookie("Herkild_Domain", $row[0]); > Logged_in(); > } > else { > wronguser(); > } > } It looks like you might be missing some quotes in your query. After you call mysql_query(), call mysql_error($mysql_link); It will show you your error in your query. -- Jason Stechschulte jpstech@unoh.edu -- There are still some other things to do, so don't think if I didn't fix your favorite bug that your bug report is in the bit bucket. (It may be, but don't think it. :-) Larry Wall in <7238@jpl-devvax.JPL.NASA.GOV>

« previous php.db (#7643) next »