Jump to content


Photo

New guy needs help :P Getting Data From a Row,


  • Please log in to reply
3 replies to this topic

#1 Zenshin

Zenshin
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 29 June 2003 - 01:27 AM

Okay, Hi I\'m new here ^_^ Nice to meet you\'ll.

Okay Ive been trying to get a good answer since im not soo good with Php/MySQL ive tryed alot, manuels and all those wonderful things and tryed another forum but they don\'t seems to give me the answer I need.

What I\'m trying to do is getting the data from `group`
where username = $username, what ever it is that is in `group` colum of that row, and echo the data,

heres on of the many thing ive tryed and my current code
mysql_result doesnt work gives me that error below:
Warning: Wrong parameter count for mysql_result() in /home/lexdark/public_html/animegenki/forums/tp.php on line 15

My code bellow
[php:1:5da8b6698e]

<html>
<head>
<title>Test Page</title>
</head>
<?php
//Connection!
$chost = \"localhost\";
$cuser = \"lexdark_Saizen\";
$cpassword = \"master\";
$cdatabase = \"lexdark_agenki\";
$conn = mysql_connect($chost, $cuser, $cpassword);
mysql_select_db($cdatabase,$conn) or die(\"Access to the database has been denied, please report this error to admin@lexdark.com\");
// Actual Codes
$fonction = mysql_query (\"SHOW `group` FROM `members` WHERE username = \'Saizen\'\");
$sql = mysql_result($fonction);
echo ($sql);
?>
<body>
</body>
</html>
[/php:1:5da8b6698e]

Thanks for any help u can give me and please make it clear ^_^

#2 baber_abbasi

baber_abbasi
  • Members
  • PipPipPip
  • Advanced Member
  • 33 posts
  • LocationPakistan

Posted 29 June 2003 - 05:57 AM

Try this;

$fonction = mysql_query (\"select group FROM members WHERE username = \'Saizen\'\");
if(mysql_num_rows($fonction) > 0){
$row = mysql_fetch_array($fonction);
do {
echo $row[\'group\'];
$row = mysql_fetch_array($fonction);
while($row);
}
}else{}

Baber N Abbasi

#3 Zenshin

Zenshin
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 29 June 2003 - 06:34 AM

thanks alot but it didnt work ;___;

#4 Zenshin

Zenshin
  • Members
  • Pip
  • Newbie
  • 4 posts

Posted 29 June 2003 - 06:59 AM

i found how to stold IT OMG! Im soo happy ^_^

thanks for the help and time provided guys ^_^
have a nice day.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users