Just trying to make a a simple IF else script. IF <whatever table> ==0 Print "Duplicate Entry on $tablename" Else $insertSql. Any direction/help would be great
Thanks:
Here is the code im using for insert.
PHP Code:
<?php
include('general/header.inc');
require_once('general/general.php');
if (!(isset($_POST['SubmitForm_x'])))
{ ?>
<<<<HTML Forms CODE is here >>>>>
<?php } else {
$insertSql = "INSERT INTO millidgeville (
sticker
,serial
,computer_name
,item
,brand
,model
,cdrom
,cpu_type
,hdd
,cpu_speed
,memory_type
,memory_install
,school
,room
,computer_use
,computer_use_other
,licence_software
,licence_software_other
,comments
) VALUES ( "
." '".addslashes($_POST['sticker'])."'"
.", '".addslashes($_POST['serial'])."'"
.", '".addslashes($_POST['computer_name'])."'"
.", '".addslashes($_POST['item'])."'"
.", '".addslashes($_POST['brand'])."'"
.", '".addslashes($_POST['model'])."'"
.", '".addslashes($_POST['cdrom'])."'"
.", '".addslashes($_POST['cpu_type'])."'"
.", '".addslashes($_POST['hdd'])."'"
.", '".addslashes($_POST['cpu_speed'])."'"
.", '".addslashes($_POST['memory_type'])."'"
.", '".addslashes($_POST['memory_install'])."'"
.", '".addslashes($_POST['school'])."'"
.", '".addslashes($_POST['room'])."'"
.", '".addslashes($_POST['computer_use'])."'"
.", '".addslashes($_POST['computer_use_other'])."'"
.", '".addslashes($_POST['licence_software'])."'"
.", '".addslashes($_POST['licence_software_other'])."'"
.", '".addslashes($_POST['comments'])."'"
.")";
$MyDb->f_ExecuteSql($insertSql);
?>