Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result


Posted on 16th Feb 2014 07:03 pm by admin

what is wrong with this

Code: [Select]<?php
if ($_SERVER['HTTP_REFERER'])
{
if($_GET['id'])
{
$con = mysql_connect("","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("rubberduckiee", $con);

$result = mysql_query("SELECT * FROM email_content where id=".$_GET['id']);

while($row = mysql_fetch_array($result))
{

if($_GET['part'] == "body")
{
echo $row['email_content_body'];
}
elseif($_GET['part'] == "footer")
{
echo $row['email_content_footer'];
}
elseif ($_GET['part'] == "header")
{
echo $row['email_content_header'];
}

}
}
}

?>i am getting the error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rubberduckiee/webapps/editor/email_editor.php on line 17

No comments posted yet

Your Answer:

Login to answer
92 Like 39 Dislike
Previous forums Next forums
Other forums

code help - pagination
Hi all, I have this code, basically a user logs into my site and they get this page.

The pro

How to file_get_contents when login required?
Hello!

I am trying to read data from a page that you have to be logged into to view, I am try

php require help needed
Ok i tried to use the search funtion but the word require is everywhere.

i'm really new to cr

Text file to .Dat file Conversion in PHP
Hi All,
Could anybody provide code for Text file to .Dat file Conversion in PHP.

Tha

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

Printer configuration
Hi All,
Suppose one of the user deleted the printer settings unfortunatly ,then what is the pro

php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur

Delete records not in top 15
Hi,

I'm creating a hall of fame page in my game and the page will only display the top 15 sco

Undefined index: username HELP NEWBIE
I am trying a simple login/logout for my website. It works well with checking if the username exists

convert pps to wsf with php'how?
hi
i want to convert with php
PowerPoint file to swf file(flash)
how please?
thank!!!

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash