Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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

Posts: 216
Location: Boston, Ma
Trades: 0
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
 
 
Register now for full access!
Old 06-25-2005, 10:30 PM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 06-25-2005, 11:07 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
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
 
Old 06-26-2005, 02:53 AM
The_Anomaly's Avatar
Extreme Talker

Posts: 216
Location: Boston, Ma
Trades: 0
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 02:57 AM..
The_Anomaly is offline
Reply With Quote
View Public Profile
 
Old 06-26-2005, 03:29 AM
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
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?
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 06-26-2005, 03:58 AM
The_Anomaly's Avatar
Extreme Talker

Posts: 216
Location: Boston, Ma
Trades: 0
I think i figured it out!

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.43485 seconds with 12 queries