Jump to content


Photo

What php script to access and input data to mysql


  • Please log in to reply
2 replies to this topic

#1 fireslug

fireslug
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 08 July 2006 - 05:43 PM

I'm brand new and totaly green to php/mysql and need a little bit of help to get started. If anyone out there is patient and condierate enough to help, I would be eternally grateful

I have at last managed to install Xxamp which allows me to play with mysql and php before uploading to the server. I have created tables in mysql but have no idea of how to access the new DB or indeed, add data to it.

Several DB were included with xxamp. I thought that I could make a few changes to one of the existing php pages so I could access the new DB that I created, but I simply can't get it to work

I can add and change data on the server, but can't do it on my PC. I have screenshot the folder and subfolders to send to anyone who can help by looking at the structure and advising the code to enter into the pgp page.

Ric

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 08 July 2006 - 05:53 PM

If you want to use a database. You'll first want to connect to the database and then select the database like so:
mysql_connect("localhost", "user", "pass");
mysql_select_db("db_name");

First change user to your mysql username and change pass to the password for the username. Now cahnge db_name to the database you want to use

You have now connected to the database. This site here provides tutorials on using PHP with MySQL.

#3 Kurt

Kurt
  • Members
  • PipPipPip
  • Advanced Member
  • 42 posts
  • LocationNew York

Posted 08 July 2006 - 05:55 PM

Also try here for other mysql functions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users