
March 4th, 2003, 03:54 AM
|
|
Junior Member
|
|
Join Date: Jan 2003
Location: Ireland
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Right , the code is as follows:
PHP Code:
<?
if(isset($add)){
if($town == ""){ $msg = 'You forgot to enter the Town.'; exit; }
if($county == ""){ $msg = 'You forgot to enter the County.'; exit; }
if($email == ""){ $msg = 'You forgot to enter the Email.'; exit; }
if($feat == "true" && $det_long == ""){ $msg = 'You forgot to enter the Long Description.'; exit; }
if($det_short == ""){ $msg = 'You forgot to enter the Short Description.<br>'; exit; }
if(($feat == "true") && ($tb == "")){ $msg = 'You forgot to select a Thumbnail.'; exit; }
if(($feat == "true") && ($pic == "")){ $msg = 'You forgot to select a Picture.'; exit; }
if(($feat == "false") && ($url == "")){ $msg = 'You forgot to enter a URL.'; exit; }
$conn = mysql_connect("localhost","ireland","route66") or die("Unable to connect to database");
$db = mysql_select_db("ireland") or die("Unable to select database ireland");
$query = "insert into `data` ( `prop` , `address` , `town` , `county` , `tel` , `fax` , `email` , `url` , `det_long` , `det_short` , `tb` , `pic` , `hi_sing` , `hi_pps` , `lo_pps` , `lo_sing` , `rural` , `feat` , `name` , `type` )
values ('".$prop."', '".$address."', '".$town."', '".$county."', '".$tel."' , '".$fax."' , '".$email."', '".$url."', '".$det_long."', '".$det_short."', '".$tb."', '".$pic."', '".$hi_sing."', '".$hi_pps."', '".$lo_pps."', '".$lo_sing."', '".$rural."', '".$feat."', '".$name."', '".$type."')";
$result = mysql_query($query);
if($result) $msg = 'Record number '.mysql_insert_id().' was written to the database.<br>';
mysql_close();
}
?>
It seems to allow you to enter about 4 records and then just stops..........
|