|
| 27 Aug 2011 03:44 AM |
I have this;
$Result = mysql_query("SELECT Beevals FROM accounts WHERE Username='" . $_COOKIE['userName'] . "'", $conn); print_r(mysql_fetch_array($Result));
It's resulting in: Array ( [0] => 1000 [Beevals] => 1000 )
How to I make it so it only results in 1000 ? |
|
|
| Report Abuse |
|
|
R4P18
|
  |
| Joined: 16 Nov 2008 |
| Total Posts: 4025 |
|
|
| 27 Aug 2011 06:03 AM |
Why not just have:
$usr = $_COOKIE['userName']; $result = mysql_fetch_array(mysql_query("select Beevals from accounts where Username='$usr'",$conn) -> Beevals; print_r($result);
$usr is your username, it does your MySQL then fetches the array and outputs it to a string.
If this doesn't work, try
echo ($result);
On the 3rd line. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 06:49 AM |
I can still SQLi it :3
[Now son, don't touch that cactus] |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 07:10 AM |
$usr = $_COOKIE['userName']; $result = mysql_fetch_array(mysql_query("select Beevals from accounts where Username='$usr'",$conn) -> Beevals; print_r($result);
Gives me:
Parse error: syntax error, unexpected ';' in /home/soulz/public_html/Profile.php on line 11 |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 07:11 AM |
Nevermind, I fixed it to $result = mysql_fetch_array(mysql_query("select Beevals from accounts where Username='$usr'",$conn)); print_r($result);
But it still comes up with Array ( [0] => 1000 [Beevals] => 1000 )
halp |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 10:04 AM |
| I would, but you vandilized the Bui|_ism wik, so, no. |
|
|
| Report Abuse |
|
|
|
| 27 Aug 2011 10:29 AM |
$result = $db->query("SELECT Beevals FROM accounts WHERE Username='$usr'")->fetch_array(); echo $result[0];
Owait you don't use MySQLi. That last line is probably what you want though. print_r is behaving exactly as it should, you're just not doing it right :V Unless there's some meaning to using print_r that I am not aware of.
|
|
|
| Report Abuse |
|
|