Hi guys,
I did a quick tutorial on the internet on using php and mysql. It is my first ever time using it so forgive me if im being a bit of a "NOOB".
anyways ill post the script below and can you give me a few pointers about where im going wrong?
Bare in mind its my first time using these scripts and phpmyadmin.
--------------------------------------------------------------------------------------------------------------
<?php
$db=mysql_connect("grafax.co.uk", "dbOne", "*password*") or die("Could not connect to localhost."); mysql_select_db("people", $db) or die("Could not find database.");
// The above lines establishes a connection with the database. Keep localhost as is unless something different is mentioned by your sql host. usrnm is user name and pswd is password. What I want to say is, copy these lines as they are and just replace the required fields and it should connect.
$querySQL = "insert into people (d_Name, d_Birthday,
d_Birthday) values ($Name, $Birthday, $Telephone)";
if(!$querySQL) error_message(sql_error());
// The above statement generates an error if you have setup the table in such a way that there should not be a duplicate entry.
?>
<form name="toSave" method="post" action="save_it.php">
<p>name
<input type="text" name="Name" size="100" />
<br>
birthday
<input type="text" name="Birthday" size="50" />
<br>
telephone
<input type="text" name="Telephone" size="50" />
</p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
--------------------------------------------------------------------------------------------------------------
Go on this link to see a screen shot of my database's settings etc.
http://www.grafax.co.uk/db.bmp
--------------------------------------------------------------------------------------------------------------
As far as i know, my database is called either web163-dbone (or as I named it dbone), the table is people, the website is http://www.grafax.co.uk.
If you need any more information just post it in this thread.
Thanks again guys :D
Max