|
-
Jun 15th, 2005, 11:45 PM
#1
Thread Starter
Hyperactive Member
Need help on SQL from PHP scripts..
Okey, heres the thing..
Lets say we have a database; TEST ,in the machine; LOCALHOST
Then in that sql database we have the table; TABLE1
in TABLE1 we have a field named; NEWVALUE and this field is of type VARCHAR and has a limit of 100 characthers,no attributes,and default NULL..
Now the problem is this..
I dont know HOW to write anything into NEWVALUE at TABLE1 in my SQLdatabase.. how do i set up my PHP script to do so..
Lets say; we need to connect and check that connection is established
we need to send user and pass..
then we need to tell which TABLE and FIELD we want to access..
then we would like to WRITE or READ or UPDATE a value there..
How do i do those basic things..??
and how do i do a thing like making a simple ADRESS BOOK:
so that i could insert NAME,LASTNAME,PHONE from my PHP script and into the SQL ad then when the page reloads, it reads the SQL database and outputs the new and all the old values...
Can anyone tell me these basics.. Im totally lost.. (i know how to make the SQL database, i know the pwd and user and DBname, and its a LOCALHOST connnection.. but reading writing deleting updating... i cant get it to work..
So please tell me something, or everything... !!
Thanks..
***************
Please use [highlight=vb] ..your code.. [/highlight] when posting code!
When you have received the working answer to your question,
please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.
Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...
Please Answer All Questions With Working Code Examples...
My Unfinished Projects and My working Programs
***************
-
Jun 17th, 2005, 01:22 AM
#2
PowerPoster
Re: Need help on SQL from PHP scripts..
http://au2.php.net/mysql
Basically you do (abbreviating the functions),
Connect
Select (your database)
Query
Fetch (if theres any records you need to retrieve)
If you have no understanding of PHP, I suggest learning that first. Otherwise, theres a snippet of code on that page that shows how to connect to a database, get that going and you should be able to work your way towards the goal of making an address book
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|