using mysql in php problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have created a registration page
http://www26a.your-server.co.za/matchm/registration4.php

On this page I have many fields, some of them pulling data out from my
database. I have a javascript validation scipt thats checks on submission of
the form to see if all required fields are filled in correctly.
IF thats the case it should submit the form. Which it isnt doing! It should
start with submission after the validation check is passed.

Then I check to see whether the BusinessName & BusinessOwner already exist,
if not then I am trying to to an insert (which it doesnt do either). Here is
the php code:
$errmsg = "";


$business_query = "SELECT BusinessName, BusinessOwner from business WHERE
BusinessName = '$BusinessName' AND BusinessOwner = '$BusinessOwner'" ;

$result = mysql_query($business_query);


if (mysql_num_rows($result) > 0) {$errmsg .= "You are already registered at
Match Makers";}

else {

if (isset($submit) == "Register Now"){mysql_query("INSERT INTO business

(BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID,
StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID,
IndustryOther, ProductService, BusinessAge, AnnualTurnoverID,
EmpowermentProfileID, BEEScoreCardID, PreferredLocationID,
PreferredProductService, PreferredMatchPartner, PreferredIndustryID,
PreferredIndustryOther, PreferredAgeID, PreferredTurnoverID,
PreferredEmpowermentProfileID, DateRegistered, MarketSourceID)

VALUES

('" . $HTTP_POST_VARS['business_name'] . "', '" .
$HTTP_POST_VARS['street_address'] . "', '" . $HTTP_POST_VARS['suburb'] . "',
$city_town, $province_desc, $street_code, $postal_address, $postal_code,
$website_address, $industry_desc, $industry_other, $product_service,
$business_age, '', '', '', '', '', '', '', '', '', '',)");


$id = mysql_insert_id();


if ($telnumber1 <> '') {mysql_query("INSERT INTO business_communication
(BusinessID,CommunicationType,Destination) VALUES ( '" . $id . "', 1, '".
$HTTP_POST_VARS['telnumber1'] . "')");}

if ($faxnumber1 <> '') {mysql_query("INSERT INTO business_communication
(BusinessID,CommunicationType,Destination) VALUES ( '" . $id . "', 2, '".
$HTTP_POST_VARS['faxnumber1'] . "')");}

if ($cellnumber1 <> '') {mysql_query("INSERT INTO business_communication
(BusinessID,CommunicationType,Destination) VALUES ( '" . $id . "', 3, '".
$HTTP_POST_VARS['cellnumber1'] . "')");}

if ($emailaddress1 <> '') {mysql_query("INSERT INTO business_communication
(BusinessID,CommunicationType,Destination) VALUES ( '" . $id . "', 4, '".
$HTTP_POST_VARS['emailaddress1'] . "')");}


echo "Your registration has been submitted";

}

}

I am not sure where exactly I am going so wrong, and it really is starting
to drive me crazy!
Regards
Garth

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux