[PHP-DB] Here goes!
Thanks all! Brand spanking new here to PHP so I will paste all the code below. I am using MySQL as my DB and i can modify the information with the same username and password that is in this code using a proprietary GUI administrator (navicat). Unfortunately it will not enter the info via this submission written below: html head titlePortfolio Entry /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FFEBEB ?php if ($submit) { $db=mysql_connect(66.220.69.20,*,**); mysql_select_db(sammies models,$db); $sql=INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ($first, $last, $age, $email, $location, $eye, $hair, $experience, $aspirations, $mtype); die (Error in Query: $sql. BR. mysql_error()); echo bcenterThank you for registering,nbsp; $first /b/centerp; ? pcenter/p center a href=http://www.sammiesmodels.com; target=_selfReturn to Sammies Models Home/a ? } else { ? /center center font face=Georgia, Times New Roman, Times, serifstrongSubmit Your Portfolio Here:/strong/font /center form name=entry method=GET action=?php echo $PHP_SELF? nbsp; table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=14%strongFirst Name:/strong/td td width=43%input name=first type=text size=30 maxlength=45/td td width=43%font size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLast Name: /strong/td tdinput name=last type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Last name shall not be used on the website, but/strong/font/td /tr tr tdstrongAge:/strong/td tdinput name=age type=text size=30 maxlength=3/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongfor internal use only./strong/font/td /tr tr tdstrongEmail:/strong/td tdinput name=email type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLocation:/strong/td tdinput name=location type=text id=location size=30 maxlength=60/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Location- please do not be specific, but only/strong/font/td /tr tr tdstrongEye Color/strong/td tdinput name=eye type=text id=eye size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongstate or region./strong/font/td /tr tr tdstrongHair Color:/strong/td tdinput name=hair type=text id=hair size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongExperience:/strong/td tdtextarea name=experience cols=60 rows=10 id=experience/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong* Any experience pertaining to your talent aspirations- school plays, photoshoots, etc../strong/font/td /tr tr td valign=topstrongAspirations:/strong/td tdtextarea name=aspirations cols=60 rows=10 id=aspirations/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongMedia Type:/strong/td tdtextarea name=mtype cols=60 rows=10 id=mtype/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong*Media type includes specific types of jobs/ offers you are interested in. /strong/font/td /tr /table table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=57% div align=right pnbsp;/p p input name=submit type=submit value=Submit /p /div/td td width=43%nbsp;/td /tr /table p align=leftnbsp; /p /form ? } ? /body /html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002
RE: [PHP-DB] Here goes!
You're missing the mysql_query($sql) or die(mysql_error()); to actually fire the data into the db. Hope this helps. -Original Message- From: John [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Here goes! Thanks all! Brand spanking new here to PHP so I will paste all the code below. I am using MySQL as my DB and i can modify the information with the same username and password that is in this code using a proprietary GUI administrator (navicat). Unfortunately it will not enter the info via this submission written below: html head titlePortfolio Entry /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FFEBEB ?php if ($submit) { $db=mysql_connect(66.220.69.20,*,**); mysql_select_db(sammies models,$db); $sql=INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ($first, $last, $age, $email, $location, $eye, $hair, $experience, $aspirations, $mtype); die (Error in Query: $sql. BR. mysql_error()); echo bcenterThank you for registering,nbsp; $first /b/centerp; ? pcenter/p center a href=http://www.sammiesmodels.com; target=_selfReturn to Sammies Models Home/a ? } else { ? /center center font face=Georgia, Times New Roman, Times, serifstrongSubmit Your Portfolio Here:/strong/font /center form name=entry method=GET action=?php echo $PHP_SELF? nbsp; table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=14%strongFirst Name:/strong/td td width=43%input name=first type=text size=30 maxlength=45/td td width=43%font size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLast Name: /strong/td tdinput name=last type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Last name shall not be used on the website, but/strong/font/td /tr tr tdstrongAge:/strong/td tdinput name=age type=text size=30 maxlength=3/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongfor internal use only./strong/font/td /tr tr tdstrongEmail:/strong/td tdinput name=email type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLocation:/strong/td tdinput name=location type=text id=location size=30 maxlength=60/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Location- please do not be specific, but only/strong/font/td /tr tr tdstrongEye Color/strong/td tdinput name=eye type=text id=eye size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongstate or region./strong/font/td /tr tr tdstrongHair Color:/strong/td tdinput name=hair type=text id=hair size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongExperience:/strong/td tdtextarea name=experience cols=60 rows=10 id=experience/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong* Any experience pertaining to your talent aspirations- school plays, photoshoots, etc../strong/font/td /tr tr td valign=topstrongAspirations:/strong/td tdtextarea name=aspirations cols=60 rows=10 id=aspirations/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongMedia Type:/strong/td tdtextarea name=mtype cols=60 rows=10 id=mtype/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong*Media type includes specific types of jobs/ offers you are interested in. /strong/font/td /tr /table table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=57% div align=right pnbsp;/p p input name=submit type=submit value=Submit /p /div/td td width=43%nbsp;/td /tr /table p align=leftnbsp; /p /form ? } ? /body /html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Here goes!
First off, Have you tried echoing the values upon submission to ensure they are being set in the form? Secondly, I would place all data code in another file for script processing - processRegistration.php would work well. If all values are being set... maybe look at: $sql=INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ($first, $last, $age, $email, $location, $eye, $hair, $experience, $aspirations, $mtype); Try: INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ('$first','$last','$age','$email', '$location','$eye','$hair','$experience','$aspirations','$mtype'); Just a few thoughts here. Aaron -Original Message- From: John [mailto:[EMAIL PROTECTED]] Sent: December 6, 2002 3:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Here goes! Thanks all! Brand spanking new here to PHP so I will paste all the code below. I am using MySQL as my DB and i can modify the information with the same username and password that is in this code using a proprietary GUI administrator (navicat). Unfortunately it will not enter the info via this submission written below: html head titlePortfolio Entry /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FFEBEB ?php if ($submit) { $db=mysql_connect(66.220.69.20,*,**); mysql_select_db(sammies models,$db); $sql=INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ($first, $last, $age, $email, $location, $eye, $hair, $experience, $aspirations, $mtype); die (Error in Query: $sql. BR. mysql_error()); echo bcenterThank you for registering,nbsp; $first /b/centerp; ? pcenter/p center a href=http://www.sammiesmodels.com; target=_selfReturn to Sammies Models Home/a ? } else { ? /center center font face=Georgia, Times New Roman, Times, serifstrongSubmit Your Portfolio Here:/strong/font /center form name=entry method=GET action=?php echo $PHP_SELF? nbsp; table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=14%strongFirst Name:/strong/td td width=43%input name=first type=text size=30 maxlength=45/td td width=43%font size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLast Name: /strong/td tdinput name=last type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Last name shall not be used on the website, but/strong/font/td /tr tr tdstrongAge:/strong/td tdinput name=age type=text size=30 maxlength=3/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongfor internal use only./strong/font/td /tr tr tdstrongEmail:/strong/td tdinput name=email type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLocation:/strong/td tdinput name=location type=text id=location size=30 maxlength=60/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Location- please do not be specific, but only/strong/font/td /tr tr tdstrongEye Color/strong/td tdinput name=eye type=text id=eye size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongstate or region./strong/font/td /tr tr tdstrongHair Color:/strong/td tdinput name=hair type=text id=hair size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongExperience:/strong/td tdtextarea name=experience cols=60 rows=10 id=experience/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong* Any experience pertaining to your talent aspirations- school plays, photoshoots, etc../strong/font/td /tr tr td valign=topstrongAspirations:/strong/td tdtextarea name=aspirations cols=60 rows=10 id=aspirations/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongMedia Type:/strong/td tdtextarea name=mtype cols=60 rows=10 id=mtype/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong*Media type includes specific types of jobs/ offers you are interested in. /strong/font/td /tr /table table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=57% div align=right pnbsp;/p p input name=submit type=submit value=Submit /p /div/td td width=43%nbsp;/td /tr /table p align=leftnbsp; /p /form ? } ? /body /html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Here goes!
Or that too hehe -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: December 6, 2002 3:51 PM To: 'John'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Here goes! You're missing the mysql_query($sql) or die(mysql_error()); to actually fire the data into the db. Hope this helps. -Original Message- From: John [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:50 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Here goes! Thanks all! Brand spanking new here to PHP so I will paste all the code below. I am using MySQL as my DB and i can modify the information with the same username and password that is in this code using a proprietary GUI administrator (navicat). Unfortunately it will not enter the info via this submission written below: html head titlePortfolio Entry /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#FFEBEB ?php if ($submit) { $db=mysql_connect(66.220.69.20,*,**); mysql_select_db(sammies models,$db); $sql=INSERT INTO models (first, last, age, email, location, eye, hair, experience, aspirations, mtype) VALUES ($first, $last, $age, $email, $location, $eye, $hair, $experience, $aspirations, $mtype); die (Error in Query: $sql. BR. mysql_error()); echo bcenterThank you for registering,nbsp; $first /b/centerp; ? pcenter/p center a href=http://www.sammiesmodels.com; target=_selfReturn to Sammies Models Home/a ? } else { ? /center center font face=Georgia, Times New Roman, Times, serifstrongSubmit Your Portfolio Here:/strong/font /center form name=entry method=GET action=?php echo $PHP_SELF? nbsp; table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=14%strongFirst Name:/strong/td td width=43%input name=first type=text size=30 maxlength=45/td td width=43%font size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLast Name: /strong/td tdinput name=last type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Last name shall not be used on the website, but/strong/font/td /tr tr tdstrongAge:/strong/td tdinput name=age type=text size=30 maxlength=3/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongfor internal use only./strong/font/td /tr tr tdstrongEmail:/strong/td tdinput name=email type=text size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr tdstrongLocation:/strong/td tdinput name=location type=text id=location size=30 maxlength=60/td tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Location- please do not be specific, but only/strong/font/td /tr tr tdstrongEye Color/strong/td tdinput name=eye type=text id=eye size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifstrongstate or region./strong/font/td /tr tr tdstrongHair Color:/strong/td tdinput name=hair type=text id=hair size=30 maxlength=45/td tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongExperience:/strong/td tdtextarea name=experience cols=60 rows=10 id=experience/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong* Any experience pertaining to your talent aspirations- school plays, photoshoots, etc../strong/font/td /tr tr td valign=topstrongAspirations:/strong/td tdtextarea name=aspirations cols=60 rows=10 id=aspirations/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td /tr tr td valign=topstrongMedia Type:/strong/td tdtextarea name=mtype cols=60 rows=10 id=mtype/textarea/td td valign=topfont size=2 face=Arial, Helvetica, sans-serifstrong*Media type includes specific types of jobs/ offers you are interested in. /strong/font/td /tr /table table width=95% border=0 cellspacing=0 cellpadding=0 tr td width=57% div align=right pnbsp;/p p input name=submit type=submit value=Submit /p /div/td td width=43%nbsp;/td /tr /table p align=leftnbsp; /p /form ? } ? /body /html --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Here goes!
Thanks a ton! The syntax ' ' was the problem- i have been stumped for 2 weeks and quite frustrated. Much appreciated all! John --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.426 / Virus Database: 239 - Release Date: 12/2/2002