My sql is provided by the company i am hosting at
I used "root" and No password
this is what i got:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/npsari/public_html/trials/connectcreate2.php on line 8
Not done connecting
Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/npsari/public_html/trials/connectcreate2.php on line 26
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/npsari/public_html/trials/connectcreate2.php on line 26
Access denied for user 'nobody'@'localhost' (using password: NO)
Does that mean anything?
An this is the code I used:
<?php
$con = mysql_connect("localhost","root","");
if ($con) {
print("Done connecting<BR>\n");
} else {
print("Not done connecting<BR>\n");
}
// connect to server
if (mysql_query('CREATE DATABASE Newdatabase')) {
echo "success";
} else {
echo mysql_error();
}
?>
hey, thanks!
However, this time it tells me:
Access denied for user 'my name'@'localhost' to database 'Newdatabase'
Do you know why?
By the way, which username and password do i use?
My server's
or my mysql
I have been trying to create database
This is the code I am using
<HTML>
<HEAD>
<TITLE>Connect & Create</TITLE>
<BODY>
<?php
$con = mysql_connect("localhost","my name","my password");
if ($con) {
print("Done connecting<BR>\n");
} else {
print("Not done connecting<BR>\n");
}
if (mysql_create_db ("Newdatabase", $con)) {
print("Created<BR>\n");
} else {
print("Not Created<BR>\n");
}
mysql_close($con);
?>
</HEAD>
</BODY>
</HTML>
This is the result I get:
Done connecting
Fatal error: Call to undefined function: mysql_create_db() in /home/npsari/public_html/trials/connectcreateinternet.php on line 23
Hey, sorry if i confused you!
I want the code to match any of the words
So, if someone searched for "brave man" only (Not the whole exact tittle)
He still gets the same result
I have a Table (in my database) which consists of 3 Colombs
Title:
Story:
Author:
I know that if the Title is only 1 word, I use this code to retreive Data:
SELECT * from $Tablename where (Title ='Word')
However, what if the tittle is more than One word (With spaces)...
Example: "The story of a brave man"
How can the code match ANY of the words in the Title
So who gives the value of this Key
Does it happen automatically?
or does the user Fill it in?
What if I called the key ID, therefore, the table has 4 rows
ID:
Name:
Accupation:
Age:
And the user only submitted the last 3 (Name, occupation, ID) in the HTML form
What happens?
I created a database...
Now, I am about to create a table
It says I have to create a Primary key for the Table!
I dont understand what is the point of this primary key
The user has 3 fields to fill-in in my Form
Name:
Occupation:
Age:
So, Do i have to create a new field (in the HTML Form) which asks the user to insert a unique ID (As this unique key)
Can someone please explain how this ID key works
Hi
I created a database
Then I created a table with the following rows
Writer:
StoryTittle:
StoryBody:
Tags:
Writer Email:
I want users to search for keywords in the "Tags" row only
And when the kewords match
All the 5 details of the writer come up
Is there a straight forward code for this, can anybody show me the way
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.