well I did this:
$query = "SELECT * FROM map WHERE id>0 ORDER BY id";
$result = mysql_query($query) or die(mysql_error());
while ($fetched = mysql_fetch_assoc($result)){
echo $fetched['land']
}
I don't really need order by id...
for ($i=0; $i<count($row); $i++) {
echo $row[$i].", ";
}
It doesn't work because in a table such as above when $i is 1 it gets the value from the table, but then $i is 2 it won't get another row with a value of 1.
Does MySQL not have a function to get all the values from the 'land' column?
hmm, It doesn't work.
// works, but only if i values don't repeat in the table,
// if they do, any other occurance of it is ignored.
for ($i=0; $i<count($row); $i++) {
echo $row[$i]."<br>";
}
// works only for values of 1 in the table even if they
// repeat.
for ($i=0; $i<count($row)...
How do I display all the values in a table in order from top to bottom, one after the other?
So fahr It only does it with specific values:
$result = mysql_query("SELECT * FROM map");
$row = mysql_fetch_row($result);
echo $row["1"];
how do I siplify it to any values, just read them out?
TonyGroves, I'll make a new table for every iteam. But you can buy an iteam twice, even with a different value, so how do I record that?
I'm making a webbased game where you can buy land, each piece of land has a different value from 1-255, now when you buy land I want it to add the lands value...
So I need to use the SET datatype? So after incrementing the length how would I add in a value?
I'll try to explain a bit more: I don't clearly know yet how MySQL works but in other programming laguages I can create a flexible 1D array with an inicial length of 1 and then increase the length of...
Hi, I'm trying to save as many integer values as possible for any user into a table.
Ex: Fist the user starts out with no additional values other than their name and password, and the iteam field is blank. And then if the user buys something it should record that into the iteam field, and when...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.