SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: newbie question
-
Apr 23, 2001, 08:36 #1
- Join Date
- Apr 2001
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hello, i have a little prob, im trying to make a price list for my page.
each row have 4 fields, ex:
Product Name | Price 1 | Price 2 | Price 3 |
So, here comes what i need to know.
How can i make this list, so i can updated it directly from the php it self, without the need to update one per one, most like i wanna my list, to show the product name, and in the other columns i need text fields that display the current prices and if i change it, when i submit the php they get updated.
i dont know if i was clear....no i wasnt...but its very extensive if i need to explain it the right way.
helps welcome.my pet its bat...so what?
-
Apr 23, 2001, 09:57 #2
- Join Date
- Jan 2001
- Location
- Exeter, Devon, UK
- Posts
- 477
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You could do it using a MySQL database, but you would still have to update each price in the DB each time it changed.
Create a table (documentation : http://www.mysql.com) in MySQL that has the same columns that you have in your PHP page. Put the data in, pull the data from the database into the page each time the script is run.
There are some good tutorials around but I'm in a bit of a rush. Work is calling!
Sorry I couldn't help more.
Good luck,
-
Apr 23, 2001, 10:03 #3
- Join Date
- Apr 2001
- Posts
- 8
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanx for your answer.
Yes...im using MySql with the same fields that my list has, what i dont know is how to make a php list, that can show me the current prices, and let me update them right from the php, without need to change the values from the mysql.
i know that there is an UPDATE command in mysql, but dont know how to tell it that update each field that i have.my pet its bat...so what?
-
Apr 23, 2001, 12:45 #4
What exactly do you mean 'change them from the mysql' do you mean telnet, phpmyadmin or what?
However once your connected to the database you can insert and update like so.
$insert=mysql_query("INSERT INTO table VALUES (0,'$variable',"$variable2','$monkeyvariable')", $connection_handle);
$update=mysql_query("UPDATE table SET field1='$newvalue', field2='$newvalue WHERE id='$id'", $connection_handle);
Hope that helps, it can be run straight from the php script.
-
Apr 23, 2001, 23:45 #5
- Join Date
- Jan 2001
- Location
- Exeter, Devon, UK
- Posts
- 477
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Nice site, Darkmonkey! Love that look.
One point, I reckon you should link the "Affiliate of the Week" GRAPHIC to the site as well as the text. Dunno why...
See ya,
Bookmarks