Hello Andy,
Thursday, March 25, 2004, 5:45:52 PM, you wrote:
AB> PHP Version 4.0.4pl1
Wow, that's an old version of PHP! It could be the cause of this,
there's nothing in you phpinfo to give anything else away (i.e. it's
identical to mine).
--
Best regards,
Richard Davey
http://www.phpcommun
"Absolutely fascinating, I have never seen a MySQL server behave like
this. Could you post which version of MySQL you're using and perhaps
the MySQL part of phpinfo()? There must be something *somewhere* that
controls this behaviour."
PHP Version 4.0.4pl1
Linux noir.propagation.net 2.0.36 #5 Wed D
Hello Andy,
Thursday, March 25, 2004, 1:17:54 PM, you wrote:
AB> yup and believe it or not if($result) only returns true if a valid
AB> username/password row can be found otherwise it returns a non existing
AB> resource
Absolutely fascinating, I have never seen a MySQL server behave like
this. C
"if ($result)
{
echo "Valid user";
} else {
echo "Error?";
}
?>
-- End here --
Now if what you're saying is correct, the final "if result()" block
should only print "valid user" if the user exists in the database,
right?"
yup and b
Hello Andy,
Thursday, March 25, 2004, 11:57:09 AM, you wrote:
AB> SELECT COUNT(username) AS hits FROM users WHERE ..."
AB> dont know because then how would i verify that the valid user was logged in
AB> or if they typed the wrong stuff in??
Because it works like this:
SELECT COUNT(username) AS
"Do you actually need to bring back the user data? What I mean is,
you're selecting * from the users table and doing nothing with it other than
worrying if the query was successful or not."
ops!! I forgot to mention that the username is used elsewhere in a different
file somewhere (to verify the s
Hello Andy,
Thursday, March 25, 2004, 10:43:54 AM, you wrote:
AB> So, just for the sake of me getting this right, it would be better code if i
AB> had the code like this:
AB> $UserExists=mysql_query("select * from users where
AB> username='$_POST[username]' and pwd=md5($_POST[password])");
AB>
So, just for the sake of me getting this right, it would be better code if i
had the code like this:
forgive the odd severely long redundant example names but... im sure that is
better than what i had before...
let me know if i got the right idea...
and $UserExists in this example is either tr
Just testing to see if this works. Sorry =)
"Mike Ford" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> On 25 March 2004 09:32, Andy B wrote:
>
> > the final line then is: if($result==false) {//test the query
> > itself..if false then
> > print whatever
> > } else {//if it did wo
Hello Andy,
Thursday, March 25, 2004, 9:53:05 AM, you wrote:
AB> um?? this way doesnt work for some strange reason... testing
AB> affected_rows returns always with 0 so:
AB> if(mysql_affected_rows()==0){...}
It depends on your query. If you are doing a SELECT query then you
cannot use affect
On 25 March 2004 09:32, Andy B wrote:
> the final line then is: if($result==false) {//test the query
> itself..if false then
> print whatever
> } else {//if it did work then do this...}
>
> but of course it could always be turned around to:
> if($result==true) {...} but dont know what way is bet
[snip]
please note this will only catch invalid queries. To catch the event
of the query being perfectly fine, but nothing coming back, just check
the values of num_rows or affected_rows (depending on the query).
[/snip]
um?? this way doesnt work for some strange reason... testing
affected_ro
Hello Andy,
Thursday, March 25, 2004, 9:32:12 AM, you wrote:
AB> but of course it could always be turned around to:
AB> if($result==true) {...} but dont know what way is better or if it
AB> is a personal choice...
A better solution might be to check if a MySQL error has been raised -
please note
hi!!
tnx for the help with that huge problem... got it running and this is how...
the query ...username='...' and pwd=md5(...) was in "" and i guess when you have
something like that putting '' in an index name is illegal?? can somebody explain why?
and on the line: if(.) {...
num_of_rows(
14 matches
Mail list logo