![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: connection, database, help, mysql, php |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| ||||
| Quote:
If there's an error message, I could have Google it and say something about it ![]() so it's basically just return me a blank page (since I didn't put anything on index.php) |
| ||||
| OK. Well, that's important too! Run this and tell me what the output is: PHP Code: |
| The Following User Says Thank You to TeraTask For This Useful Post: | ||
HelloWorld (08-04-2007) | ||
| ||||
| wow, that's really helpful.. thanx a lot TeraTask. but why doesn't it get detected with the the code that I had: Code: or die(mysql_error() Code: 9) 11) 19) 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 'KEYusername VARCHAR(10) NOT NULL, password VARCHAR(10) NOT NULL)' at line 1 Last edited by HelloWorld : 08-04-2007 at 01:51 AM. |
| ||||
| It doesn't show up b/c the error is in your mysql_query statement, not in the connection. After each mysql_xxx() statement, you should check for an error. or die(); isn't a very friendly check either. Try replacing the create table with this: Code: CREATE TABLE `mycms` ( `id` int(11) unsigned NOT NULL auto_increment, `username` varchar(10) NOT NULL, `password` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) Also, take note that I have made the primary key primary and unsigned. These are good things for almost every primary key. So, how did I get this code to generate the table? I created the table in phpmyadmin and then chose export the table structure - all the code perfectly generated for me with virtually no effort. OK. Time for me to finally go to bed. gl! |
| ||||
| For some reason the webtest database still doesn't show me any tables: PHP Code: ![]() |
| ||||
| Look very closely at the code I put up there against your own code. You didn't copy-and-paste. ![]() P.S. It's not necessary to break a string up into a bunch of pieces as you're doing. Just put single quotes around it and let it span as many lines as you want. Last edited by Lee : 08-04-2007 at 03:19 AM. Reason: Please edit your last post!!! :) |
| The Following User Says Thank You to TeraTask For This Useful Post: | ||
HelloWorld (08-04-2007) | ||
| ||||
| Quote:
PHP Code: |
![]() |
| Thread Tools | |
| Display Modes | |
| |