Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 16

107.161.x.x forum
179.61.x.x forum
3.80.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x top
46.229.x.x comment
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.4.x.x forum
5.173.x.x news
78.46.x.x forum
79.165.x.x news
85.203.x.x news

Last Seen

mrstipfan Wed 19:48
Gagi2 Mon 16:30
EFiNST0RM Sun 15:39
85filip58 Sun 12:14
brlight Tue 04:18

Newest Members

Forums
SELECT FROM DATABASE
lexta
Fri Nov 04 2011, 06:56PM
Posts: 15
Joined: Sun Jan 16 2011, 05:02PM
Registered Member #6517
Hi, I want to select data from db with this script:

<?php
$con 
mysql_connect("localhost","user","pass");
if (!
$con)
  {
  die(
'Could not connect: ' mysql_error());
  }

mysql_select_db("db"$con);

$result mysql_query("SELECT `ip` FROM `lgsl` WHERE `id`=1");

while(
$row mysql_fetch_array($result))
  {
  echo 
$result;
  }

mysql_close($con);
?>


But in the web page show's me:

Resource id #2


What can i do to show me ip from id 1 ?
Website
Dodgeitorelse
Fri Nov 04 2011, 10:52PM
Posts: 246
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
change while loop to

while($row = mysql_fetch_array($result))
{
echo $row[0];
}

lack of effort on your part requires less effort on my part
Website
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org