generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Anyone good with PHP+MySQL?

Previous Thread :: Next Thread 
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
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 is not online. 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
Megamatrixdude is not online. Megamatrixdude
Joined: 06 Dec 2009
Total Posts: 10939
27 Aug 2011 06:49 AM
I can still SQLi it :3

[Now son, don't touch that cactus]
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
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
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
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
roperson1337 is not online. roperson1337
Joined: 25 May 2011
Total Posts: 435
27 Aug 2011 10:04 AM
I would, but you vandilized the Bui|_ism wik, so, no.
Report Abuse
pokelover980 is not online. pokelover980
Joined: 12 Jun 2009
Total Posts: 4141
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image