iGuest 3 Report post Posted November 17, 2004 mysql with php. Continued from the php tutorialthis uses tables like Excel...sooo you create headings for tables along the x axis.....and can have lots of rows with different values. Its called a database..but the best analogy is probably with excel.You can use php to insert data, delete data, or edit data.... but..1) first you need to connect.e.g. at the top of the page you need to write something like this ADJUSTING the values for your host: <?//set database connection variables$hostname='localhost';$uname='';$password='';$database='';//establish database connectionmysql_connect($hostname,$uname,$password);?> you can make this a bit more complicated....to produce an error if it doesnt work, and if it does, to select the database://set database connection variables$hostname='localhost';$uname='username';$password='password';$database='database name';//establish database connection$connect = mysql_connect($hostname,$uname,$password);//display error if connection failsif ($connect==FALSE) { print 'Unable to connect to database: '.mysql_error();} else {//select databasemysql_select_db($database);}/*-----------------------------------*/?> Now.... either of those will work..or should do You can use them in 1 of 2 ways...for instance, you could save one as db.phpthen write<?include 'db.php';////make the rest of the page?> at the top of each php file that you want to use the database in.or you could just write it out over and over again in each page - most sites use the first idea.then add / insert delete files...more added later... people who want to take it further feel free to do so in a reply Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 18, 2004 u forgot that u can update the data with php 2, nice tut Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 28, 2004 welbis keep on with the good work nice tut Share this post Link to post Share on other sites