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

PHP File Upload Problem
Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

Writing to the middle of a file
Hi I have a bit of a problem. Is there any way i can write some text to a middle of a text file. For

Open/Close Links in Php
Hello, Hoping someone can inform me how I can get PHP to automatically open a set of links in a new

How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capt

for some reason mysql query not working, not inserting, please check it out
This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Extract specific information from a PHP Multidimensional Array
Howdy! I've racked my brain over this for 24 hours now. I think it's time I asked for help. I'm lear

Date Format
Hi there,

I have a date format like this right now:
Sat, 17 Oct 2009 17:04:00

I ne

At max how many columns is advisable to create in a table/view
Hi All,
I have two transaction table from which i want to create a simple view or material

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

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