/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//Connection //Creat DB //Create table $sql = "CREATE TABLE Persons ( id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, FirstName varchar(15) NOT NULL, LastName varchar(15) NOT NULL, Age int, PRIMARY KEY (id) )"; //Insert row in table //Update row //Delete row //Select one row echo $row['LastName']; //Select more rows echo $row['LastName']; } //Select more rows order by Age discending from the rows from 0 to 10 $result = mysql_query("SELECT * FROM Persons WHERE FirstName='Peter' ORDER BY Age DESC LIMIT 0,10") or die(mysql_error()); echo $row['LastName']; }