Link to home
Start Free TrialLog in
Avatar of enyceexdanny
enyceexdanny

asked on

PHP/MYSQL - Query is empty error. =/

Hello everyone. I'm having a bit of a dumbfounded moment here. For some reason, this script below which simply inserts 2 fields to the mysql db is giving a "query is empty" error.

$_SESSION['auth']="yes";
$logname = $_POST['fusername'];
$_SESSION['logname'] = $logname;
$today = date("Y-m-d h:m:s");
$sql = "INSERT INTO Member (loginName, loginTime) VALUES ('$logname', '$today')";
echo "$logname, $today"; // to see if there's a variable issue both variables echo correctly.
mysql_query($sq1) or die(mysql_error());

I've looked over this short code many dozens of times, but I just can't seem to figure it out.
I've used this same code, to directly insert them via phpmyadmin and it works fine.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of glcummins
glcummins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The eyes get a little blurry after too many hours of coding and debugging, no? :)
Avatar of enyceexdanny
enyceexdanny

ASKER

oh my.... You're right!
Haha, I feel extremely silly at the moment.

Anyways, thanks for the awesome quick response as always from ee. ^_^
Yeah. It actually looks identical.. I had to copy and paste that "1" into google. =)
maybe it's time to change the code font in zend.. lowercase L and 1 look exactly identical!.=O
I've tried fiddling on my end with other fonts that would differentiate better, but I always end up back at a monospace fixed font, because I think I can read the rest of the code better. If you find a font that works well for you, let me know! :)
Proggy clean seems pretty decent.
http://www.tactile3d.com/tristan/