•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,787 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,840 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 393 | Replies: 10 | Solved
![]() |
i am trying to set up this db and i am getting a parse error which it says it is on line 24 i cannot see the error. help need
$sql="CREATE TABLE IF NOT EXISTS `merc_users` ( `****` int not null, `******` varchar (250) not null, `*****` varchar(250) not null, `******` varchar(250) not null, `*****` varchar(250) not null, `******` varchar (250) not null, `*******` varchar(250) not null, `****` varchar(250) not null, `****` varchar(250) not null, `******` varchar (250) not null, `********` varchar(250) not null, `******` int not null )"; mysql_query($sql) or die (mysql_error() mysql_errno()); (line 24)
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
•
•
•
•
mysql_query($sql) or die (mysql_error() mysql_errno());
php Syntax (Toggle Plain Text)
mysql_query($sql) or die (mysql_error(). mysql_errno());
Cheers,
Naveen
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
There is nothing wrong with your create table query. The only thing that I found missing was the dot operator. Do you still have the error ? If yes, you need to post your complete code as I don't see any other errors!
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
is it possible to create a new db on the server with a new user name and password without having to login to the phpmyadmin section on the control panel on the server?
i have had a look around but all the information i have found is already using a user name and passwrod to make the connection. I want to be able to create everything from the beginning. could you point me in the right direction of a good tutorial on this.
i have had a look around but all the information i have found is already using a user name and passwrod to make the connection. I want to be able to create everything from the beginning. could you point me in the right direction of a good tutorial on this.
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
•
•
•
•
is it possible to create a new db on the server with a new user name and password without having to login to the phpmyadmin section on the control panel on the server?
Eg.
php Syntax (Toggle Plain Text)
<?php $con = mysql_connect("localhost","root"); mysql_select_db("test"); $query = "Create user 'naveen'@'localhost' IDENTIFIED BY 'password1'"; mysql_query($query); $query2 = "GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'naveen'@'localhost'"; mysql_query($query2); mysql_close($con); echo mysql_connect("localhost","naveen","password1"); ?>
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
Yep. It will create a user called "naveen" with password "password1" and grant SELECT,INSERT,UPDATE,DELETE permissions for that user.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the MySQL Forum
- Previous Thread: Is there a shorter version of this query?
- Next Thread: Need urgent help Please



Linear Mode