THIS is not like the others lol...
Q1: how do I select a specific one line (E.G select line 32, and set a variable to it)
so $strlvlmon = $row['myrow'] (select certain line in that row)
how to set a variable to a value in a MySQL DB?
Moderator: General Moderators
-
Mythic Fr0st
- Forum Contributor
- Posts: 137
- Joined: Sat Dec 02, 2006 3:23 am
- Contact:
- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
-
Mythic Fr0st
- Forum Contributor
- Posts: 137
- Joined: Sat Dec 02, 2006 3:23 am
- Contact:
umm
say I have
baby elf, (baby elf info)
wood elf, (wood elf info)
dark elf, (dark elf info)
blood elf, (blood elf info)
now, if I type the below it will reveal the stuff for baby elf, conditional to the row I want
Now, how could I directly skip to say blood elfs stats? without typing the above 3 more times...
(btw mlvl is my main level, and i've set it to auto_increment thing, I read somewhere its used to track a certain section...
hmph
baby elf, (baby elf info)
wood elf, (wood elf info)
dark elf, (dark elf info)
blood elf, (blood elf info)
now, if I type the below it will reveal the stuff for baby elf, conditional to the row I want
Code: Select all
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("monsters", $con);
$result = mysql_query("SELECT * FROM m_l");
$row = mysql_fetch_array($result);
$ml=$row['mlvl']; //<(mlvl being row)
$strlvlmon=$row['strlvlmon'];
$strdmgmon=$strlvlmon / 4;
$strdmg=rand(0, $strdmg * 1.3);
$strdmg=round($strdmg);(btw mlvl is my main level, and i've set it to auto_increment thing, I read somewhere its used to track a certain section...
hmph