Data not saving to the database....
Posted by: stevenazari (---.dynamic.dsl.as9105.com)
Date: May 30, 2007 10:28PM

Hello smiling smiley

just wanted to say hi - wasnt that a breath of fresh air? grinning smiley




..... ok seriously guys I love you for making this program - and you MUST keep up the good work grinning smiley but in your own time of course ;o)

anyway I got mr wampserver installed (latest version! - ooooo) I had some initial teething problems with the header("location:example.html"winking smiley; code working but I think I have that done and dusted yawning smiley) (yey)

but my only problem now (before I can really give it a go) is saving to the database.

I've done
<?php
require"conninfo.php";
?>

and I dont get any errors with the code held within that file (which is used to connect to my database) I have edited php.ini to report all errors (but still nothing)

So I have register.htm which is a form, which uses method="post" to send to register1.php which then adds that info to the database. My code in register1.php is:

-----------------------------------------------------

<?php
require"conninfo.php";
$username=$_POST["username"];
$password=$_POST["password"];
$firstname=$_POST["firstname"];
$surname=$_POST["surname"];
$dateofbirth=$_POST["dateofbirth"];
$gender=$_POST["gender"];
$email=$_POST["email"];
$address1=$_POST["address1"];
$address2=$_POST["address2"];
$city=$_POST["city"];
$country=$_POST["country"];
$postcode=$_POST["postcode"];
$telephone=$_POST["telephone"];

$query = "insert into members (username, password, firstname, surname, dateofbirth, gender, email, address1, address2, city, country, postcode, telephone) values ('$username','$password','$firstname','$surname','$dateofbirth','$gender','$email','$address1','$address2','$city','$country','$postcode','$telephone')";

header("location:registrationsuccess.html"winking smiley;
?>

----------------------------------------------------

As I said, I get no errors, but at the same time upon checking my database - I get no info saved there yawning smileys does anyone have any ideas why?

thanks a bazillion smiling smiley

mr shteven azari.

no you cant have what Im taking.

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: stevenazari (---.dynamic.dsl.as9105.com)
Date: May 31, 2007 12:23AM

btw my conninfo.php is in the same folder as all my files so the directory is root/assignment2/conninfo.php..... here is the info from that:

<?$strServer="localhost";

$strDatabase="5alive";

$strUser="root";
$strPwd="gaynor";

$strDB=mysql_connect($strServer,$strUser,$strPwd)or die("Could not open database"winking smiley;
$database=mysql_select_db("$strDatabase",$strDcool smiley;
?>

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: CyberSpatium (71.237.217.---)
Date: May 31, 2007 08:49AM

you are using php short tag, chane:
<?$strServer="localhost";

to
<?php
$strServer="localhost";



CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: stevenazari (---.dynamic.dsl.as9105.com)
Date: May 31, 2007 12:09PM

I've just done that but it didnt work sad smiley

weird how it doesnt say <?php in my post because in my file it does confused smiley weird. oh well. is there anything else I can do?

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: CyberSpatium (71.237.217.---)
Date: May 31, 2007 04:43PM

what exactly is being displayed?


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: stevenazari (---.dynamic.dsl.as9105.com)
Date: June 01, 2007 10:01PM

how do you mean displayed?

from the database: nothing as nothing is saved to itk
on the site: it goes to registrationsuccess.htm (or what ever the file is called) no errors or anything confused smiley Im oooo eee ooo aaa aaa about it all.... and thats messed up

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: CyberSpatium (71.237.217.---)
Date: June 01, 2007 11:50PM

when you run your code, what is being displayed, what do you see?



CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: stevenazari (---.dynamic.dsl.as9105.com)
Date: June 02, 2007 09:25PM

it just gets processed as you would expect it to - submits information and takes me to the next page to say its been submitted and how amazingly attractive I am.

Options: ReplyQuote
Re: Data not saving to the database....
Posted by: CyberSpatium (71.237.217.---)
Date: June 02, 2007 10:08PM

Here are some recent posts on my web development newbie blog that will help you.

Creating and Using a Database with MySQL
http://webdevnewbie.com/2007/06/01/creating-and-using-a-database-with-mysql/

PHP MySQL Tutorial
http://webdevnewbie.com/2007/05/06/php-mysql-tutorial/


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.

Options: ReplyQuote


Sorry, only registered users may post in this forum.