LiveWire Peer Support Network

Printable Version of Topic "PHP/MySQL Help."

- LiveWire Teen Forums & College Forums (http://www.golivewire.com)
-- (http://www.golivewire.com/forums/support-technical.html)
--- Web Design & Search Engine Optimization (http://www.golivewire.com/forums/forum-200-s-0.html)
---- PHP/MySQL Help. (http://www.golivewire.com/forums/peer-ppabet-support-a.html)


-- Posted by RossTheHoss69 at 5:53 pm on Mar. 25, 2008

Okay, anytime I create a PHP file to try and make a new MySQL database using the line:
Code:

CREATE DATABASE testdb;
?>

I get:
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\xampp\69.php on line 3.
I'm using Apache.
Help?
Why am I getting this message?


-- Posted by allsmiles at 9:17 am on Mar. 26, 2008

It needs to be
Code:

mysql_connect('serveraddress','username','password');
mysql_query("CREATE DATABASE testdb");
?>


-- Posted by PiXiE at 9:21 am on Mar. 26, 2008

mysql =/= php. That is why you need mysql_query().


www.golivewire.com