Hi guys i have the following table
main_table
id
title
sub_title
contenido
I want to edit the content using the following code:
[code=php]<?php
$con = mysql_connect(“localhost”,”sparkle”,”sparkle”);
if (!$con)
{
die(mysql_error());
}
mysql_close($con);
if(isset($_GET[‘id’]))
$id=$_GET[‘id’];
else
$id=1;
$query = (“select title, sub_title, contenido from main_page WHERE id=$id”);
if ($row=mysql_fetch_array($query))
{
$title = $row[‘title’];
$sub_title = $row[‘sub_title’];
$contenido = $row[‘contenido’];
}
?>
but i have the following error messge
Warning: mysql_fetch_array() expects parameter 1 to be resource, string given in C:wampwwwsparklenshine2adminedit.inc.php on line 18
Can please help me… thanks i am new a php