Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- on INSERT an empty row BEFORE the data is inserted


Umm_Hasan - 10:09 pm on Mar 10, 2011 (gmt 0)


Thanks timster, i'll search for it and try it out. My form actually submits to a php page that ONLY holds the php (hence form action="registration_processor.php" method="post") and the form is on a XHTML only page (registration2011.html)

I'm am a newbie to php and mysql so i wasnt aware that it would only insert ONE row, I thought it would insert ALL rows that contain a Level field that has the value of whatever table its going into here's what I wrote up so you can see what I mean:


//build pk_kg table
$sql="INSERT INTO PK_KG (rFname, rLname)
SELECT FirstName, LastName
FROM Registration2011 WHERE Level = PKG";
mysql_query($sql);
$sql="INSERT INTO PK_KG (pFname, pLname)
SELECT PartnerFirstName, PartnerLastName
FROM Partners2011 WHERE pLevel = PKG";
mysql_query($sql);

//build 1to3 table
$sql="INSERT INTO 1to3 (rFname, rLname)
SELECT FirstName, LastName
FROM Registration2011 WHERE Level = 1to3";
mysql_query($sql);
$sql="INSERT INTO 1to3 (pFname, pLname)
SELECT PartnerFirstName, PartnerLastName
FROM Partners2011 WHERE pLevel = 1to3";
mysql_query($sql);

//build 4to6 table
$sql="INSERT INTO 4to6 (rFname, rLname)
SELECT FirstName, LastName
FROM Registration2011 WHERE Level = 4to6";
mysql_query($sql);
$sql="INSERT INTO 4to6 (pFname, pLname)
SELECT PartnerFirstName, PartnerLastName
FROM Partners2011 WHERE pLevel = 4to6";
mysql_query($sql);

//build 7to9 table
$sql="INSERT INTO 7to9 (rFname, rLname)
SELECT FirstName, LastName
FROM Registration2011 WHERE Level = 7to9";
mysql_query($sql);
$sql="INSERT INTO 7to9 (pFname, pLname)
SELECT PartnerFirstName, PartnerLastName
FROM Partners2011 WHERE pLevel = 7to9";
mysql_query($sql);

//build 10to12 table
$sql="INSERT INTO 10to12 (rFname, rLname)
SELECT FirstName, LastName
FROM Registration2011 WHERE Level = 10to12";
mysql_query($sql);
$sql="INSERT INTO 10to12 (pFname, pLname)
SELECT PartnerFirstName, PartnerLastName
FROM Partners2011 WHERE pLevel = 10to12";
mysql_query($sql);
/****************END LEVEL BUILD*****************/


Maybe, based on this its obvious i'm a novice but the idea for me is to figure out how to do what I need to do now since i'm on a deadline of this project which is supposed to have live registration in mid April.

Yes this gives me a month BUT I have to get everything working correctly into the DB first, then write all my javascript for the client side to require all fields and verify data, then get some server side cleansing/verification going and working right, then I need to send the FULLY FUNCTIONAL version to all who are working on this (this is a volunteer ONLY project - everyone involved is volunteering thier services) and have them test the form and the leaders will then let me know what he/she likes/dislikes then I have to apply all changes if any, make sure those changes if any work, and have the registration process ready to be fully functional for USERS (many will be teens so it has to be full idiot proof) by mid april -- hence my need to post in forums and not just read, try, read try, read try...ya know.

Again, thanks all for your time and assistance!


Thread source:: http://www.webmasterworld.com/php/4279219.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com