Jump to content

Warning: mysql_result() expects parameter 1 to be resource, boolean given in D:\


crave_kevin

Recommended Posts

don't know what to do next with this error popping up,,,any help?

 

 

<?php

//set up the variables

$loguser = $_POST['loguser'];

$logpass = md5($_POST['logpass']);

$login = $_get['login'];

 

//connect with the server and the database

mysql_connect("localhost","root","") or die("Can't connect with the Server!");

mysql_select_db("comp3project") or die("Can't connect with the database!");

 

if($login="yes")

{

$get = mysql_query("SELECT count(cid) FROM customer_data WHERE username = '$loguser'

and password = '$logpass'");

$result = mysql_result($get,0);

 

if($result!=1){print "Login Failed!";}

else {print "Login Successful!";}

}

?>

I don't think you need to put those quotes around the variables inside the query. You've enclosed your query in double quotes already, which means you can put variable names straight in there and it'll still work..

Try removing the single quotes around $loguser and $logpass.

 

Denno

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.