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!";}

}

?>

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.