...

View Full Version : STUPID ERRORS...Uhhh



fimi
12-14-2003, 12:23 AM
hi,
im trying to make a simple login system but whenever i execute the query from the script with mysql_query i get no answer.
However, when i execute the same query in phpmyadmin i get the answer....its making me so nervous!!!!!ohhhhh :rolleyes: :confused:


SELECT username,passwd FROM gl_users WHERE username='fimi' AND passwd='ef43d744e6227ce0cca48d34a2a4880a'

// that is the result of:
$query = "SELECT username,passwd FROM gl_users WHERE username='$u_name' AND passwd='$u_pass'";

//now, when i try to see how many rows were effected get no answer!

$result = mysql_query($query) or die("Error: " . mysql_error());

// NOW FOR mysql_num_rows($result) i get now value!!!!





WTF is going on??????:mad:
what m'i doing wrong?:o

thx....

SDP2006
12-14-2003, 12:41 AM
What error(s) are you getting? That would help us help you.

Also, if you want a good, sound login system you might want to try Nightfire's Login Lite - http://blinded.org.uk/scripts/loginlite.php

fimi
12-14-2003, 12:45 AM
lol, i don't get any errors!
simply, i got get answers from the database!

SDP2006
12-14-2003, 12:51 AM
If there is nothing in the database, you will get nothing from the database. Sorta like the bank, if there is no money in it, you cant get any money out.

fimi
12-14-2003, 12:56 AM
yes i know but the when i execute that query in the database i get an answer....and im 100% sure that i should get the result back.

about Nightfire's Login Lite i have the same thing(same ideas and stuff like that).

SDP2006
12-14-2003, 12:58 AM
Queries acts a tad differently when executing it inside of a PHP File. What might work in PHPMyAdmin, might not work inside of a PHP file.

fimi
12-14-2003, 12:59 AM
ok so what do i do?

SDP2006
12-14-2003, 01:28 AM
Click 'Create PHP Code' and copy/paste that into your query.

fimi
12-14-2003, 01:48 AM
thx alot SDP2006, the site that you gave me it worked!

SDP2006
12-14-2003, 03:06 AM
You're script works now?

Great! Glad I have been a help.

Nightfire
12-14-2003, 10:15 AM
Did you connect to the database?

fimi
12-15-2003, 05:56 AM
yes, it allways connected to the database, but i recieved no results when when there was results.

i started playing much more and trying EVERYTHING possible and and at some time i got it to work. i think php was just messing me up.

SDP2006, my script works...thx alot

im doing templates now....smarty template engine is the best!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum