LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 885 users online 225019 members 1218 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
Millerr
Favs: movies ill watch anything
Mood: Flirty
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
8 online / 23 MPM
Fresh Topics
  LiveWire / Technical Forums / Web Design & Search Engine Optimization / Adding Reply

Adding Reply
Archived Topic: It will not be bumped to the top of the forum.
Topic PHP/MySQL Help.
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
RossTheHoss69 Posted 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:

<?php
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?

Replies
PiXiE Posted at 9:21 am on Mar. 26, 2008
mysql =/= php. That is why you need mysql_query().
allsmiles Posted at 9:17 am on Mar. 26, 2008
It needs to be
Code:

<?php
mysql_connect('serveraddress','username','password');
mysql_query("CREATE DATABASE testdb");
?>
All 2 previous replies displayed.