[thelist] Include function in CODE doesn't work (blank output)

kasimir-k kasimir.k.lists at gmail.com
Sat Feb 14 04:00:23 CST 2009


> HP Thniah scribeva in 2009-02-12 13:07:
>> I have an issue with running this PHP script on PHP Triad ver 2.2.
>>
>> The issue is that the following sub-code (using INVOLVE function) below
>> produces a blank output.
> ...
>> if($rec=mysql_fetch_array(mysql_query("SELECT * FROM cus_info WHERE
>> login='$userid' AND password = '$password'")))
>> {
>> if(($rec['userid']==$userid)&&($rec['password']==$password))

kasimir-k scribeva in 2009-02-14 11:52:
> If there's no output, then the conditions aren't met - that is either 
> mysql_fetch_array returns no rows or $userid and $password don't match.

I was too quick replying: if the first condition failed, then there 
would be output (wrong login message). So it's the second condition 
failing, probably because instead of $rec['userid'] you should have 
$rec['login']. But you don't need that second condition at all. If 
$userid and $password aren't correct, then the first condition alredy 
fails - no need to test again (especially with wrong column name ;-)

.k



More information about the thelist mailing list