Weird MySQL error, why am I recieving this?
Posted on
16th Feb 2014 07:03 pm by
admin
PHP Code:
<?php require "global_settings.php"; ?>
<title><?php echo $sitetitle; ?></title>
<center><style type="text/css">
a:link {
color:#24374C;
text-decoration:bold;
}
a:visited {
color:#24374C;
text-decoration:bold;
}
a:active {
outline: none;
color:#24374C;
text-decoration:bold;
}
body {background-color:#b0c4de}
div.box {
width:250px;
padding:10px;
border:3px double #000000;
margin:10px;
background-color:#74AFF2;
}
p
{
border-top-style:dotted;
border-right-style:solid;
border-bottom-style:dotted;
border-left-style:solid;
}
div.menu-blue {
BORDER-RIGHT: #333366 1px solid;
BORDER-LEFT: #6699cc 1px solid;
BORDER-TOP: #6699cc 1px solid;
BORDER-BOTTOM: #333366 1px solid;
FONT-WEIGHT: normal;
FONT-SIZE: 2px;
COLOR: #ffffff;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
BACKGROUND-COLOR: #23559C;
TEXT-DECORATION: none;
font-stretch : condensed;
}
.menu-top {
BORDER-RIGHT: 1px solid #333366; BORDER-TOP: 1px solid #6699CC; FONT-WEIGHT: normal; FONT-SIZE: 2px; BORDER-LEFT: 1px solid #6699CC; COLOR: #FFFFFF; BORDER-BOTTOM: 1px solid #333366; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; BACKGROUND-COLOR: #23559C; TEXT-DECORATION: none;
font-stretch : condensed
}
</style>
<center>
<div class='menu-blue'>
<div align="center">
<table width="600" cellspacing="1" cellpadding="5" style="background-color:#23559C">
<tr>
<td style="background-color:#FFFFFF">
<div align="center">
<table border="0">
</form>
</table>
<?php
$con = mysql_connect("$dbhost", "$dbuser", "$dbpassword") or die(mysql_errno());
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc())
{
$_POST = array_map('stripslashes', $_POST);
}
$name = $_POST['name'];
$message = $_POST['message'];
//getting the data if the user is banned or not
$get = mysql_query("SELECT * FROM users");
while ($row = mysql_fetch_assoc($get))
{
// get data
$ban_check = $row['banned'];
if ($ban_check ==1) {
echo "Your account has been disabled. You are no longer allowed to post.";
}
else {
if (!$name) {
echo "<div class='box'><b><span style='color:red'>You must be logged in to post!</span></b></div>";
}
else
{
//connect
$connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!");
mysql_select_db("$db") or die("Database fail!");
//write
$write = mysql_query("INSERT INTO posts VALUES ('','$name','$message')") or die(mysql_error());
$postcount = mysql_query("UPDATE users SET post_count = post_count + 1 WHERE username='$name'");
echo "<div class='box'><font face='arial'><b><span style='color:green'>Posted! Your name was:</span> $name</b> - Your message was....
<b>$message - <a href='bbdemo.php'>View it!</a></b>";
}
}
}
?>
Error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a5488351/public_html/post.php on line 86
No comments posted yet
Your Answer:
Login to answer
298 33
Other forums
User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor
mysql_query returning boolean instead of mysql ressource
Hi,
I seem to have a weird issue with the php command mysql_query. I pass 2 arguments the que
BIG file upload!
Hey guys!
I'm trying to upload a file, it works well with smaller files but with 60mb+, I get
mysq_num_rows
Hi,
I want to use:
Code: if(mysql_num_rows($ergebnis2)==2)
how can the value 2, be
Merger of 6 sister companies under one flagship company after go live
Dear Experts,
I need one help regarding Merger of sister companies of same group. currently we
I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bun
Get value from Select menu
Hi!
Have tried to find the solution on the web. Don't know if there is an easy one. A descrip
Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove
Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne