Page 1 of 1
How do I set a value to something in a Database?
Posted: Sat Dec 09, 2006 3:37 pm
by Mythic Fr0st
How would I say
connect to mysql
then create table, and add lists...
and $strlvlelf=1 but in the database? so it has a value
Posted: Sat Dec 09, 2006 3:59 pm
by John Cartwright
Moved to PHP-Code.
err
Posted: Sat Dec 09, 2006 4:03 pm
by Mythic Fr0st
Err sorry, just woke up, forgot this was a php code thingy
(basically im asking how do I set a value to it)
Posted: Sat Dec 09, 2006 6:05 pm
by ok
You ask how to update an entry in the DB?
Code: Select all
UPDATE `table` SET `column1` = 'value' WHERE `column2` = 'something'
SQL tutorial in w3school:
http://www.w3schools.com/sql/default.asp
Re: err
Posted: Sat Dec 09, 2006 6:57 pm
by RobertGonzalez
Mythic Fr0st wrote:Err sorry, just woke up, forgot this was a php code thingy
(basically im asking how do I set a value to it)
What have you done so far? Try something first then post when your code doesn't work as expected.
hmm
Posted: Sat Dec 09, 2006 7:41 pm
by Mythic Fr0st
Nothing yet, all i know about MySQL is how to add em etc..
I wanna add a value to a certain thing before entering it...
E.G
elf has 4 strength
I wanna create the table 'elf'
and put
strlvlelf=4
into the database (Not update)
Posted: Sat Dec 09, 2006 7:56 pm
by RobertGonzalez
Might a suggest you get a book, read through that, try some stuff then ask for help with what you are trying? In the meantime, look at these functions and see how you can apply those to your app.
mysql_connect()
mysql_select_db()
mysql_query()
mysql_affected_rows()
mysql_fetch_array()
Also look through the MySQL manual at
http://www.mysql.com for table structure syntax, field types, data types, SELECT, INSERT, UPDATE and DELETE queries. Learn a bit of this stuff first, then we can help you really learn how to use it.