[thelist] help with project design
Abdullah Mancy
mancy3000 at gmail.com
Tue Nov 25 15:52:27 CST 2008
here is correction to my code i was missing column value into the insert
query
<?
$items = array('HREF'=>'link',' TITLE'=>'title','
BLURB'=>'text','BDATE'=>'beginning date','EDATE'=>'end date','EXPOS'=>'');
foreach($items as $item => $message)
{
if(isset($_POST[$item]))
{
$$item = $_POST[$item];
}
else
{
$$item = "";
$errormsg = "Please Select " . $message . " for the AD.";
}
}
mysql_select_db($mysql);
$sql = "INSERT INTO textads (HREF, TITLE, BLURB,BDATE,EDATE,EXPOS) VALUES
('$HREF','$TITLE', '$BLURB', '$BDATE', '$EDATE', '$EXPOS')";
mysql_query($sql) or die('Error, insert query failed');
?>
On Tue, Nov 25, 2008 at 11:49 PM, Abdullah Mancy <mancy3000 at gmail.com>wrote:
> oh sorrychange $query line to
>
> $query = "INSERT INTO `textads` (HREF, BLURB, TITLE) VALUES
> ('$HREF','$TITLE','$BLURB')";
>
>
> On Tue, Nov 25, 2008 at 11:48 PM, Abdullah Mancy <mancy3000 at gmail.com>wrote:
>
>> change $query line to
>>
>> $query = "INSERT INTO 'textads' ('HREF', 'BLURB', 'TITLE') VALUES
>> ('$HREF','$TITLE','$BLURB')";
>>
>>
>
More information about the thelist
mailing list