Insert Data Into Mysql Database
Insert Data Into Mysql Database
<?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="test_mysql"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB");
Update/Edit data from mysql database "UPDATE table_name SET column_name1=' value', column_name2=' value' WHERE column_name=' value' "; Grab the code and paste in your text editor. You have to customize 7 spots in this code (see images below). 1. Code to connect to your DB - place or include your code to connect to database. 2. $tbl_name - your table name. 3. $adjacents - how many adjacent pages should be shown on each side. 4. $targetpage - is the name of file ex. I saved this file as pagination.php, my $targetpage should be "pagination.php". 5. $limit - how many items to show per page. 6. "SELECT column_name - change to your own column. 7. Replace your own while..loop here - place your code to echo results here. After all, save and test your script.