Jump to content

npsari

Members
  • Posts

    393
  • Joined

  • Last visited

Everything posted by npsari

  1. Ohh, so I go to mySQL and create a user name "root" and a password of my choice is that what you mean?
  2. 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(); } ?>
  3. 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
  4. 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
  5. Thank you that is what i was looking for good info
  6. So, can $word be more than one word Can it be two words separated by spaces?????
  7. 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
  8. Thanks ................ What if the Title has spaces? Example: The story of a brave man What will the code be?
  9. 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
  10. 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?
  11. Thanks for your reply However, I already know that You didnt answer my question
  12. 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
  13. 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
×
×
  • Create New...

Important Information

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.