Jump to content

[SOLVED] MySQL error


MySQL_Narb

Recommended Posts

Error:

 

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/runevid/public_html/Quests/finished_tutorial.php on line 28

 

Code:

 

<?php



$username = $_SESSION['username'];

//connect
$connect = mysql_connect("l","","pebopebogizmo96") or die("Connection failed!");
mysql_select_db("runevid_betas") or die("Database fail!");

//check to see if they have or haven't done the quest
$get = mysql_query("SELECT * FROM betas");
while ($row = mysql_fetch_assoc($get))

$check = $row['quest1'];

if ($check ==1)
{
echo "<br /><br />It seems you've already done this quest and gained your reward.<br /><br />";
}
else
{

//write
$update_complete = mysql_query("UPDATE betas SET quest1 = quest1 + 1 WHERE username='$username'");
$points = mysql_query("UPDATE betas SET points = points + 3 WHERE username='$username'");

echo "<b><span style='color:green'>You have completed quest and gained 3 points!</span></b>";

}
?>

Link to comment
https://forums.phpfreaks.com/topic/178394-solved-mysql-error/
Share on other sites

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.