Jump to content

What php script to access and input data to mysql


fireslug

Recommended Posts

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
Link to comment
Share on other sites

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

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. [url=http://www.php-mysql-tutorial.com/]This site here[/url] provides tutorials on using PHP with MySQL.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.