Reply
sql, no idea :?
Old 06-25-2005, 09:20 PM sql, no idea :?
The_Anomaly's Avatar
Extreme Talker

Posts: 201
Location: Boston, Ma
I'm trying to do these tutorials in a book for php. This one tutorial is making a small basic forum. It nees to access a databse and gave me this sql code...

Code:
mysql> create table forum_topics (
	->topic_id int not null primary key auto_increment, 
	->topic_title varchar (150), 
	->topic_create_time datetime,
	->topic_owner varchar (150)
	-> );

mysql> create table forum_posts (
	-> post_id int not null primary key auto_increment, 
	-> topic_id int not null, 
	-> post_text text, 
	-> post_create_time datetime, 
	->post_owner varchar (150)
	-> );
I have no idea what to do with it and the book doesnt say. I tri3ed going to the admin panel in the phpMyAdmin and using a text file with that code in it to create the DB. i got a bunch of errors and it said make sure your using the right syntax for this kind of SQL server. I'm using a program called easyPHP which is like evrything you need to run a small server for testing.

Anyone have any idea what i can do with this code
The_Anomaly is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 06-25-2005, 09:30 PM
Republikin's Avatar
Super Moderator

Posts: 3,191
You have the basic idea down, just use phpMyAdmin to create the db first, then select that db and run the above query against it.
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-25-2005, 10:07 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
That code will not create the database, You will need to do that first.

The code they gave you is assuming you have mysql command line access. Simply remove the mysql> and -> parts and you should be able to run the queries in phpMyAdmin
Anacrusis is offline
Reply With Quote
View Public Profile Visit Anacrusis's homepage!
 
Old 06-26-2005, 01:53 AM
The_Anomaly's Avatar
Extreme Talker

Posts: 201
Location: Boston, Ma
I deleted the mysql> parts and all of the -> parts and get a new error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysql> create table forum_posts (
post_id int not null prima





nvm i forgot to delete the second mysql> part of it. i guess you shouldnt go to the bar all night anjd try to work on coding

I do get this error when running my PHP page. I'm not sure on how to change user names and passwords. anyone know how to using mysql?

error: Warning: mysql_connect(): Access denied for user 'joeuser'@'localhost' (using password: YES) in c:\program files\easyphp1-8\www\mycoding\topiclist.php on line 3
Access denied for user 'joeuser'@'localhost' (using password: YES)

Last edited by The_Anomaly : 06-26-2005 at 01:57 AM.
The_Anomaly is offline
Reply With Quote
View Public Profile
 
Old 06-26-2005, 02:29 AM
metho's Avatar
Ultra Talker

Posts: 345
So did you create a database and user account for the script to run on? I notice in the error msg that you've used 'joeuser', did you create this account? Does the account have create privilages in the database?
metho is offline
Reply With Quote
View Public Profile
 
Old 06-26-2005, 02:58 AM
The_Anomaly's Avatar
Extreme Talker

Posts: 201
Location: Boston, Ma
I think i figured it out!

Last edited by The_Anomaly : 06-26-2005 at 03:02 AM.
The_Anomaly is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to sql, no idea :?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14517 seconds with 12 queries