PHP interesse |
|
ik krijg deze fout:
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/halvezool/domains/halvezool.be/public_html/pizza.php on line 35
en dit is me script
<?php /* ------------------------- */
$_GET['s'] = intval($_GET['s']);
$_POST['omnilog'] = 1;
$OMNILOG = 1;
include("_include-config.php");
if(! check_login()) {
header("Location: login.php");
exit;
}
$dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup`,UNIX_TIMESTAMP(`online`) AS `online` FROM `[users]` WHERE `login`='{$_SESSION['login']}'");
$data = mysql_fetch_object($dbres);
mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'");
/* ------------------------- */ ?>
<html>
<head>
<title>[( Criminals )]</title>
<link rel="stylesheet" type="text/css" href="css-v1.css">
</head>
<body style="background: #AA3C3C; margin: 0px">
<body link="#666666" vlink="#666666" alink="#666666" style="background: #AA3C3C; margin: 0px;">
<table align="center" width=100%>
<tr><td class="subTitle"><b>Pizzatent</b></td>
<tr>
<td class="mainTxt"> Welkom Pizzaria La-Canone. Hier kan je heerlijke pizza's
eten!! <br>
Er worden dit uur nog <?php
$pizzatent = mysql_query("SELECT * FROM `pizzatent`") or die(mysql_error());
$pizzatent = mysql_fetch_object($pizzatent);
$pizzatent->aantal; ?> Pizza's gemaakt.
<tr>
<td class="mainTxt">
<?php /* ------------------------- */
$query = mysql_query("SELECT * FROM `[users]` WHERE login = '$data->login'");
$user = mysql_fetch_array($query);
$inzet=2500;
$inzet=3000;
$inzet=3500;
if ($user[cash] <= $inzet-1) {
print "<CENTER>Je Merkt net dat je niet genoeg geld op zak hebt!</CENTER><br><CENTER>Je zal geen pizza's kunnen eten.</CENTER>";
exit;}
if(isset($_POST['ja'])) {
$inzet = 2500;
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `honger`=`honger`-25 WHERE `login`='{$data->login}'");
print " <tr><td class=\"mainTxt\">Je hebt een pizza Margharita gegeten, je honger is voor 25 gestild.</td></tr>\n";
}
if(isset($_POST['ja1'])) {
$inzet = 3000;
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `honger`=`honger`-50 WHERE `login`='{$data->login}'");
print " <tr><td class=\"mainTxt\">Je hebt een pizza Quatro Stagionné gegeten, je honger is voor 50 gestild.</td></tr>\n";
}
if(isset($_POST['ja2'])) {
$inzet = 3500;
mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'");
mysql_query("UPDATE `[users]` SET `honger`=`honger`-70 WHERE `login`='{$data->login}'");
print " <tr><td class=\"mainTxt\">Je hebt een pizza Totale gegeten, je honger is voor 70 gestild.</td></tr>\n";
}
?>
</td>
</tr>
<tr><td class="mainTxt" align="center">
<form method="post"><table align="center">
<td align="right">Pizza Margharita (€ 2500,-)
<input type="submit" name="ja" value="Eten"></td></tr>
<td align="right">Pizza Quatro Stagionné (€ 3000,-) <input type="submit" name="ja1" value="Eten"></td></tr>
<td align="right">Pizza Totale (€ 3500,-) <input type="submit" name="ja2" value="Eten"></td></tr>
</FORM>
</table>
</body>
</html>
<?php /* ------------------------- */ $_GET['s'] = intval($_GET['s']); $_POST['omnilog'] = 1; $OMNILOG = 1; include("_include-config.php"); if(! check_login()) { header("Location: login.php"); } $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup`,UNIX_TIMESTAMP(`online`) AS `online` FROM `[users]` WHERE `login`='{$_SESSION['login']}'"); mysql_query("UPDATE `[users]` SET `online`=NOW() WHERE `login`='{$data->login}'"); /* ------------------------- */ ?> <html> <head> <title>[( Criminals )]</title> <link rel="stylesheet" type="text/css" href="css-v1.css"> </head> <body style="background: #AA3C3C; margin: 0px"> <body link="#666666" vlink="#666666" alink="#666666" style="background: #AA3C3C; margin: 0px;"> <table align="center" width=100%> <tr><td class="subTitle"><b>Pizzatent</b></td> <tr> <td class="mainTxt"> Welkom Pizzaria La-Canone. Hier kan je heerlijke pizza's eten!! <br> Er worden dit uur nog <?php $pizzatent->aantal; ?> Pizza's gemaakt. <tr> <td class="mainTxt"> <?php /* ------------------------- */ $query = mysql_query("SELECT * FROM `[users]` WHERE login = '$data->login'"); $inzet=2500; $inzet=3000; $inzet=3500; if ($user[cash] <= $inzet-1) { print "<CENTER>Je Merkt net dat je niet genoeg geld op zak hebt!</CENTER><br><CENTER>Je zal geen pizza's kunnen eten.</CENTER>"; if(isset($_POST['ja'])) { $inzet = 2500; mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'"); mysql_query("UPDATE `[users]` SET `honger`=`honger`-25 WHERE `login`='{$data->login}'"); print " <tr><td class=\"mainTxt\">Je hebt een pizza Margharita gegeten, je honger is voor 25 gestild.</td></tr>\n"; } if(isset($_POST['ja1'])) { $inzet = 3000; mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'"); mysql_query("UPDATE `[users]` SET `honger`=`honger`-50 WHERE `login`='{$data->login}'"); print " <tr><td class=\"mainTxt\">Je hebt een pizza Quatro Stagionné gegeten, je honger is voor 50 gestild.</td></tr>\n"; } if(isset($_POST['ja2'])) { $inzet = 3500; mysql_query("UPDATE `[users]` SET `cash`=`cash`-$inzet WHERE `login`='{$data->login}'"); mysql_query("UPDATE `[users]` SET `honger`=`honger`-70 WHERE `login`='{$data->login}'"); print " <tr><td class=\"mainTxt\">Je hebt een pizza Totale gegeten, je honger is voor 70 gestild.</td></tr>\n"; } ?> </td> </tr> <tr><td class="mainTxt" align="center"> <form method="post"><table align="center"> <td align="right">Pizza Margharita (€ 2500,-) <input type="submit" name="ja" value="Eten"></td></tr> <td align="right">Pizza Quatro Stagionné (€ 3000,-) <input type="submit" name="ja1" value="Eten"></td></tr> <td align="right">Pizza Totale (€ 3500,-) <input type="submit" name="ja2" value="Eten"></td></tr> </FORM> </table> </body> </html>
Citaat: Rensjuh edit:
[..code..][/code]tags!
|