PHP/MySQL question

Discuss all aspects of programming here.

Moderator: The Mod Squad

PHP/MySQL question

Postby Falklian » Fri Dec 24, 2004 1:00 pm

I am just learning PHP/MySQL and think I'm gettin' a pretty good handle of it all (keyword there is "think" :lol: ) Anyway, I have a portion of my site that has an area that I'd like to store in my database and be editable through an admin panel (which I already have set up)

My question is, how would I go about overwriting a database entry?

Basically, I'm thinkin' about making a form with just a text area and a submit button. I want that to be filled with the content of the page (which I know how to do) but when I submit it, instead of making a new entry, I'd like to overwrite it, or remove the previous entry and add a new one, if that's possible?

I've been looking at tutorials and they've helped out a lot. I just haven't seen anything that talks about what I'm trying to do :lol:

Thanks in advance :D
Falklian
Black Belt
Black Belt
 
Posts: 921
Joined: Tue Oct 01, 2002 2:06 pm
Location: Illinois

Postby MoboCop » Fri Dec 24, 2004 6:52 pm

You need to learn about sql statements.

Select
Insert
Replace
Update

Basically the concept is you make a form with the fields representing the data you want to insert/update.

When the form is submitted you gather the data into a sql statement and send it to the the sql server.

Here is an excellent site to learn mysql information.

http://www.keithjbrown.co.uk/vworks/mysql/

you will also notice a complete section on php/mysql.

I highly recommend this site. The author explains things very clearly with real word examples and covers a wide range of topics.
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno

Postby Toby B. » Thu Jan 13, 2005 2:24 am

How in the world did I miss this thread? 8O Will definfately have to bookmark that site... :wink:

Thanks MoboCop!
Toby B.
Lead Mobo-fu Master
Lead Mobo-fu Master
 
Posts: 14277
Joined: Sun Dec 16, 2001 1:01 am
Location: Maine

Postby MoboCop » Thu Jan 13, 2005 7:43 am

sure.
Not everything that can be counted counts, and not everything that counts can be counted - Albert Einstien
MoboCop
Drunken Master
 
Posts: 8854
Joined: Tue Jan 18, 2000 1:01 am
Location: Fresno


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests