I learned PHP and now want to get into MySQL. I have a host w/ MySQL supported and I'm using phpMyAdmin to update. What exactly do I need to do to get my database up and running. I understand the whole SQL language, I just can't seem to get it to work properly. Does anyone know of any good tutorials that deal with incorporating the SQL code into the web document...not just with all the SQL commands??
Last edited by tenniskid493; 02-03-2006 at 10:22 PM.
Note that the multiple lines are just a visual formatting thing - the query would execute the same if you had it all on the same line. However, it is often convenient to break it up to make the source code easier to read. I usually do that by using the "heredoc" method of defining a string:
$query = <<<EOD
INSERT INTO test
VALUES ('Name', 'Age', 'Birthday')
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_affected_rows();
echo "<p>$rows row(s) inserted into database</p>\n";
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation