Current location: Hot Scripts Forums » Programming Languages » PHP » Getting sigle filed name or value from the database


Getting sigle filed name or value from the database

Reply
  #1 (permalink)  
Old 09-06-10, 06:43 AM
vasanthnaidu vasanthnaidu is offline
New Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Getting sigle filed name or value from the database

<?php
$mysqli = mysqli_init();
//$mysqli->real_connect('localhost', 'datasmar', '1984mehera20113', 'datasmar_real');
$mysqli->real_connect('localhost', 'root', '', 'realestate');
if (mysqli_connect_errno())
{
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}



$mysqli->real_query("CALL Proc_USERTYPE_select()");

if($objResult = $mysqli->store_result())
{
function mysql_fetch_full_result_array($objResult)
{
$table_result=array();
echo 'r-->'.$r=0;
while($row = mysqli_fetch_assoc($objResult)){
$arr_row=array();
$c=0;
echo '<br>';
while ( $c < mysqli_num_fields($objResult)) {
echo 'c------>'.$c;
$col = mysqli_fetch_field($objResult, $c);
$arr_row[$col -> name] = $row[$col -> name];
$c++;
}
$table_result[$r] = $arr_row;
$r++;


}
return $table_result;
}


$GetVal=mysql_fetch_full_result_array($objResult);
echo '<br>';
echo 'rr-->'.$GetVal[0]['usert_types'];
echo '<br>';
print_r($GetVal);
$objResult->free_result();

$mysqli->close();
}
?>

this is my code i wants to out put like this

example echo 'rr-->'.$GetVal[0]['usert_types'];

rr-->India

i don't know the error message comes like this



########## Error ########################
http://localhost/Bussiness/test.php

r-->0
c------>0
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28
c------>1
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28

c------>0
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28
c------>1
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28

c------>0
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28
c------>1
Warning: mysqli_fetch_field() expects exactly 1 parameter, 2 given in D:\wamp\www\Bussiness\test.php on line 28

rr-->
Array ( [0] => Array ( [] => ) [1] => Array ( [] => ) [2] => Array ( [] => ) )
#########################################


please help me what mistake i have done.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make offline database consistent bubuna Database 1 12-07-10 12:56 PM
Filling out a registry form multiple times from an MySQL Database aeisecurity PHP 7 03-25-08 09:09 AM
Simple, searchable book database max fischer Script Requests 0 05-14-05 02:00 PM


All times are GMT -5. The time now is 08:51 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.