Question: PHP Create a new text file. When doing the assignment, copy all the MySQL commands you used to complete the assignment from start to finish
PHP Create a new text file. When doing the assignment, copy all the MySQL commands you used to complete the assignment from start to finish into the text file.
Create a demographics database with a table that contains the following fields: country, primary language, and population. Enter records for at least 10 countries. You can find demographic information for various countries in many places on the Internet, including Wikipedia (http://www.wikipedia.org/). Write queries that return the following:
- A list of all records sorted by country name
- The country with the highest population
- The country with the lowest population
- Countries that share a common language, such as French
This is the coding that I have so far in a text file... I guess I'm kind of confused.. do you think that I should add the MySQL commands at the end of my text file? If so, could anyone help me with that?
php $con = mysql_connect("mysql.cic.ksu.edu", "DB-id","password"); if(!$con) { die('Could not connect:'.mysql_error()); }
mysql_Select_db("DB-id", $con);
$sql = " INSERT INTO table( Country, planguage, population) VALUES ('$-POST[Country]', '$-POST[planguage]', '$-POST[population]')";
if(!mysql_query($sql,$con)) { die('Error:'.mysql_error()); }
echo "1 record added";
mysql_close($con)
?>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
