PHP - How To Fetch The Value From Stdclass Object?
Hi all, I need some help with my code as I have a hard time with fetching the value from the stdclass. I am using json data to convert it to PHP so I would like to fetch the "appears" data from the stdclass object. When I try this: echo $data->appears;
I'm getting this: Notice: Trying to get property of non-object in /home/username/public_html/foldername/script.php on line 22
I have also tried this: echo $data[0]->appears->value;
And this: echo $data->appears[0]->value;
I am still get the same error so I dont know what to do to resolve it.
Full code: <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $json = '{"data":{"185.220.101.46":{"domains_count":0,"domains_list":null,"updated":"2019-12-02 22:04:25","spam_rate":1,"frequency":6827,"frequency_time_24h":106,"frequency_time_1h":2,"network_type":"hosting","in_antispam":1,"in_security":0,"appears":1,"country":"DE","submitted":"2018-01-11 20:34:37","frequency_time_10m":2,"sha256":"e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248"}}}'; // Converts it into a PHP object $data = json_decode($json, true); //print_r($data); echo $data["appears"]->value ."<br/>"; //var_dump($data[1]->{'updated'}); //echo $data->updated[1]->value; ?>
STDClass object: Array ( [data] => Array ( [185.220.101.46] => Array ( [domains_count] => 0 [domains_list] => [updated] => 2019-12-02 22:04:25 [spam_rate] => 1 [frequency] => 6827 [frequency_time_24h] => 106 [frequency_time_1h] => 2 [network_type] => hosting [in_antispam] => 1 [in_security] => 0 [appears] => 1 [country] => DE [submitted] => 2018-01-11 20:34:37 [frequency_time_10m] => 2 [sha256] => e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248 ) ) )
Var_dump: array(1) { ["data"]=> array(1) { ["185.220.101.46"]=> array(15) { ["domains_count"]=> int(0) ["domains_list"]=> NULL ["updated"]=> string(19) "2019-12-02 22:04:25" ["spam_rate"]=> int(1) ["frequency"]=> int(6827) ["frequency_time_24h"]=> int(106) ["frequency_time_1h"]=> int(2) ["network_type"]=> string(7) "hosting" ["in_antispam"]=> int(1) ["in_security"]=> int(0) ["appears"]=> int(1) ["country"]=> string(2) "DE" ["submitted"]=> string(19) "2018-01-11 20:34:37" ["frequency_time_10m"]=> int(2) ["sha256"]=> string(64) "e39d4a9be2f210d1a75ba2b5ece08a4b35e99002b03aeb6ceaad1d98de87c248" } } }
Can you please show me an example how I can fetch the `appears` from the stdclass object? Any advice would be much appreciated. Edited December 2, 2019 by mark107Similar TutorialsI have been trying to access an stdClass I can't. This stdClass gets returned from a method in a class . below the query is right all I want to do is put admi into a session var but I can't seem to access the obj. I can print_r and it displays. I am sure that it is easy. being new to PDO I am getting lost at times. Any help would be greatfully recieved Code: [Select] stdClass Object ( [Admin_Level] => admi ) Hi guys, I have below values in array Code: [Select] stdClass Object ( [Category] => stdClass Object ( [ChildCategoryDescription] => 50s / 60s ERA [ChildCategoryID] => 87 [GrandchildCategoryDescription] => - [GrandchildCategoryID] => 25 [ParentCategoryDescription] => CONCERTS [ParentCategoryID] => 2 ) [Description] => Tony Bennett [ID] => 1073 [HomeVenueID] => 0 ) When am calling Desciption object by $resultsObj->Description then i got the result " Tony Bennett" but i do not know to get the value GrandchildCategoryID . Just i tried this Code: [Select] echo $resultsObj->$resultsObj->ParentCategoryID and i got below error. Catchable fatal error: Object of class stdClass could not be converted to string in D:\Program Files\xampp\htdocs\t1\genericLib.php on line 255. How i can get this value... why do i keep getting this error from line 7? Object of class stdClass could not be converted to string Code: [Select] <?php include_once"../includes/db_connect.php"; $item_number="2"; $custom="54298"; $query=mysql_query("SELECT `prodID`, `quanity` FROM `cart` WHERE `sessID`='$custom'") or mysql_error(); while($cart=mysql_fetch_object($query)){ mysql_query("INSERT INTO `orderItems` ( `id` , `orderInfoID` , `productID` , `quanity` ) VALUES ('', '$item_number', '$cart-> prodID', '$cart->quanity');"); } mysql_query("UPDATE `cart` SET `show`='1' WHERE `sessID`='$custom'"); ?> I have a stdClass Object Multi Dimensional Array that I need to dissassemble into variables but dont know how to pull the data. The array looks like this: Code: [Select] stdClass Object ( [results] => Array ( [0] => stdClass Object ( [address_components] => Array ( [0] => stdClass Object ( [long_name] => 1600 [short_name] => 1600 [types] => Array ( [0] => street_number ) ) [1] => stdClass Object ( [long_name] => Pennsylvania Ave NW [short_name] => Pennsylvania Ave NW [types] => Array ( [0] => route ) ) [2] => stdClass Object ( [long_name] => Northwest Washington [short_name] => Northwest Washington [types] => Array ( [0] => neighborhood [1] => political ) ) [3] => stdClass Object ( [long_name] => Washington [short_name] => Washington [types] => Array ( [0] => locality [1] => political ) ) [4] => stdClass Object ( [long_name] => District of Columbia [short_name] => DC [types] => Array ( [0] => administrative_area_level_1 [1] => political ) ) [5] => stdClass Object ( [long_name] => United States [short_name] => US [types] => Array ( [0] => country [1] => political ) ) [6] => stdClass Object ( [long_name] => 20500 [short_name] => 20500 [types] => Array ( [0] => postal_code ) ) ) [formatted_address] => 1600 Pennsylvania Ave NW, Washington, DC 20500, USA [geometry] => stdClass Object ( [location] => stdClass Object ( [lat] => 38.8987149 [lng] => -77.0376555 ) [location_type] => ROOFTOP [viewport] => stdClass Object ( [northeast] => stdClass Object ( [lat] => 38.900063880291 [lng] => -77.036306519708 ) [southwest] => stdClass Object ( [lat] => 38.897365919709 [lng] => -77.039004480291 ) ) ) [partial_match] => 1 [types] => Array ( [0] => street_address ) ) ) [status] => OK ) Really I need to start with pulling the lat and lng from the location. No clue how to get to this data. Hi i'm struggling to pull data from an stdClass Object which searches google for an item. This is the code that pulls out the information Code: [Select] <?php $encoded_response = file_get_contents("https://www.googleapis.com/shopping/search/v1/public/products?key=AIzaSyDCrZzoEB46bliROIn8JgOImm0B5YvxbVY&country=US&q=0014633144796"); $response = json_decode($encoded_response); print_r($response); ?> (can be seen at:http://www.rafoggin.com/Shrop/googletestapi.php i've tried Code: [Select] $object = $result[0]; $print = $object->kind; echo $print and Code: [Select] foreach ($result->product as $print) { echo $print->googleId;and many other variations but can't get it to work. ideally i'd like to pull the images out, but the structure confuses me. Your help is really appreciated, I can't figure this out. hi, very strange issue. when I create test e-mail or I will forward the specific e-mail, the script works correctly - saves attachment into server disk. now, when I configure to check another mailbox, it gives me error: Num Messages 11 Fatal error: Cannot use object of type stdClass as array in /test/emailattach/index.php on line 34 index.php: Code: [Select] <?php $mbox = imap_open("{mail.server.com:143}", "email@email", "XXX") or die('Cannot connect to mail: ' . imap_last_error()); // make connection with mailbox and check # messages if ($hdr = imap_check($mbox)) { echo "Num Messages " . $hdr->Nmsgs ."\n\n<br><br>"; $msgCount = $hdr->Nmsgs; } else { echo "failed"; } $overview=imap_fetch_overview($mbox,"1:$msgCount",0); $size=sizeof($overview); // get message info for($i=$size-1;$i>=0;$i--) { $val=$overview[$i]; $msg=$val->msgno; $from=$val->from; $date=$val->date; $subj=$val->subject; $seen=$val->seen; $from = ereg_replace("\"","",$from); // Check for attachements and store them $struct = imap_fetchstructure($mbox,$msg); $contentParts = count($struct->parts); if ($contentParts >= 2) { for ($ix=2;$ix<=$contentParts;$ix++) { $att[$ix-2] = imap_bodystruct($mbox,$msg,$ix); } for ($k=0;$k<sizeof($att);$k++) { if ($att[$k]->parameters[0]->value == "us-ascii" || $att[$k]->parameters[0]->value == "US-ASCII") { if ($att[$k]->parameters[1]->value != "") { $FileName[$k] = $att[$k]->parameters[1]->value; $FileType[$k] = strrev(substr(strrev($FileName[$k]),0,4)); } } elseif ($att[$k]->parameters[0]->value != "iso-8859-1" && $att[$k]->parameters[0]->value != "ISO-8859-1") { $FileName[$k] = $att[$k]->parameters[0]->value; $FileType[$k] = strrev(substr(strrev($FileName[$k]),0,4)); $fileContent = imap_fetchbody($mbox,$msg,$file+2); $fileContent = imap_base64($fileContent); $localfile = fopen("$FileName[$k]","w"); fputs($localfile,$fileContent); fclose($localfile); } } } } imap_close($mbox); ?> Could there be some encoding issue? with thanks, Margus Hi Guys, I need help I have setup a code recently : this is the code : $za['MIN(spec_positionid)'] and it gave me an error saying : Cannot use object of type stdClass as array but if I change to this : $za->spec_positionid it works, but I need to get the MIN value from the database. can someone please help. this is very urgent for me..... I am just trying out PDO and I get this error, Fatal error: Call to a member function fetch() on a non-object, but isn't it already on the $this->db object? class shoutbox { private $db; function __construct($dbname, $username, $password, $host = "localhost" ) { # db conections try { $this->db = new PDO("mysql:host=".$hostname.";dbname=".$dbname, $username, $password); } catch(PDOException $e) { echo $e->getMessage(); } } function getShouts() { $sql_shouts = $this->db->query('SELECT shoutid, message, pmuserid, ipadress, time FROM shouts WHERE pmuserid == 0'); return $sql_shouts->fetch(PDO::FETCH_OBJ); } } Hello together, i ve got a script what returns the html code from anonther side. $CR_URL= 'https://nomoreangel.de/api-reader/?apiid=cr-de-148-f9ea2d50ee296914d740c8bde66cc3bb761b1560&rawOut=on'; $html = file_get_html($CR_URL); $ret = $html->find('pre', 0); echo $ret; echo $ret gives me following Output:
stdClass Object ( [repaired_defenses] => Array ( ) [generic] => stdClass Object ( [cr_id] => f9ea2d50ee296914d740c8bde66cc3bb761b1560 [event_time] => 2021-03-05T23:17:59+01:00 [event_timestamp] => 1614982679 [combat_coordinates] => 1:22:11 [combat_planet_type] => 1 [combat_rounds] => 0 [loot_percentage] => 75 [winner] => attacker [units_lost_attackers] => 0 [units_lost_defenders] => 0 [attacker_count] => 1 [defender_count] => 1 [loot_metal] => 843324 [loot_crystal] => 431284 [loot_deuterium] => 226605 [combat_honorable] => [attacker_honorable] => [attacker_honorpoints] => 0 [defender_honorable] => [defender_honorpoints] => 0 [moon_created] => [moon_chance] => 0 [moon_size] => 0 [moon_exists] => 1 [debris_metal_total] => 0 [debris_crystal_total] => 0 [debris_metal] => 0 [debris_crystal] => 0 [debris_reaper_metal_retrieved] => 0 [debris_reaper_crystal_retrieved] => 0 [debris_pathfinder_metal_retrieved] => 0 [debris_pathfinder_crystal_retrieved] => 0 [wreckfield] => Array ( ) ) [attackers] => Array ( [0] => stdClass Object ( [fleet_owner] => Kurzer [fleet_owner_id] => 110574 [fleet_owner_character_class_id] => 3 [fleet_owner_coordinates] => 1:170:15 [fleet_owner_planet_type] => 1 [fleet_owner_planet_name] => suche_deut [fleet_owner_alliance] => Eis Kalte Engel [fleet_owner_alliance_tag] => EKE [fleet_armor_percentage] => 210 [fleet_shield_percentage] => 210 [fleet_weapon_percentage] => 220 [fleet_composition] => Array ( [0] => stdClass Object ( [ship_type] => 219 [armor] => 7130 [shield] => 310 [weapon] => 640 [count] => 311 ) ) ) ) [defenders] => Array ( [0] => stdClass Object ( [fleet_owner] => Croupier [fleet_owner_id] => 114969 [fleet_owner_character_class_id] => 3 [fleet_owner_coordinates] => 1:22:11 [fleet_owner_planet_type] => 1 [fleet_owner_planet_name] => Suche deut [fleet_owner_alliance] => [fleet_owner_alliance_tag] => [fleet_armor_percentage] => 120 [fleet_shield_percentage] => 120 [fleet_weapon_percentage] => 120 [fleet_composition] => Array ( ) ) ) [rounds] => Array ( ) ) Now i want to get access to these Object, but because it is a string, i can t access the values.
Can somebody help me? I am using the following code
foreach ($fbdata->data as $post ) { $posts .= '<li>'; $posts .= '<p>' . $post->message . '</p>'; $posts .= date('d-M-y', strtotime($post->created_time)); $posts .= '</li>'; } and if the message propeerty doesn't exist I get the message above. Any ideas on the best way to fix this? error Notice: Undefined property: stdClass::$post_url in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 133 Notice: Undefined property: stdClass::$post_title in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 133 Notice: Undefined property: stdClass::$post_date in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 137 Notice: Undefined variable: fb in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 138 Notice: Undefined variable: tw in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 140 Posted Posted on | Facebook Facebook Twitter Twitter Notice: Undefined property: stdClass::$post_content in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 153 Notice: Undefined property: stdClass::$post_url in /home/sites/inspiredanceacademy.com/public_html/sno-blog-test/lib/social_news_office.php on line 154 http://www.socialnewsoffice.com/blog_posts?start=0&api_key=b5cbd66dca99c49d1a6c3d ive used this a my json Code: [Select] //check if you have curl loaded if(!function_exists("curl_init")) die("cURL extension is not installed"); function Social_News_Office($action, $api_key){ // jSON URL which should be requested $json_url = $action.'&api_key='.api_key.''; // Initializing curl $ch = curl_init( $json_url ); // Configuring curl options $options = array( CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array('Content-type: application/json') , ); // Setting curl options curl_setopt_array( $ch, $options ); // Getting results return $result = json_decode(curl_exec($ch)); // Getting jSON result string } $blog_posts = Social_News_Office('http://www.socialnewsoffice.com/blog_posts?start=2&display=6', api_key); foreach($blog_posts as $post) { echo '<!--START OF POST--> <div class="post"> <h2 class="post-heading"><a href="' . BLOG_BASE_URL . 'article/' . $post->post_url . '/">' . strip_tags($post->post_title) . '</a></h2> <!--START OF BLOG INFO--> <p class="meta"> <img alt="Posted" class="meta-img" src="http://www.socialnewsoffice.com/blog-images/time.png"> Posted on ' . $post->post_date . ' | <a target="_blank" href="'.$fb.'" class="socialusers icon Facebook"> <img alt="Facebook" src="http://www.socialnewsoffice.com/blog-images/facebook.png"> Facebook </a> <a target="_blank" href="http://twitter.com/#!/'.$tw.'" class="socialusers icon Twitter"> <img src="http://www.socialnewsoffice.com/blog-images/twitter.png" alt="Twitter" align="baseline"> Twitter </a> </p> <!--START OF POST CONTENT--> <div class="post-content">'; if(!empty($post->article_img)){ echo '<a href="' . BLOG_BASE_URL . 'article/' . $post->post_url . '/"> <img alt="' . strip_tags($post->post_title) . '" class="post-thumbnail" src="' . BLOG_BASE_URL . 'sno-blog/thumbnail.php?file='.$post->article_img.'&width=240&height=160" title="' . strip_tags($post->post_title) . '"></a>'; } echo '<p>' . $post_content = substr(strip_tags($post->post_content,'<p><br><a>'),0,266).'...' . '</p> <a class="read-more" href="' . BLOG_BASE_URL . 'article/' . $post->post_url . '/">Continue reading</a> <div class="clear"></div> </div><!--END OF POST CONTENT--> </div><!--END OF POST-->'; } Hey all, I want to have an object that has a property which is an object containing instances of other objects. I try this: Code: [Select] class Blog extends Posts { public $has_posts; public function __construct($a,$b,$c){ $has_posts = (object) array_merge((array) $a, (array) $b, (array) $c); } } class Posts { public $b; public function __construct($b){ $this->b = $b; } } $post1 = new Posts(1); $post2 = new Posts(2); $post3 = new Posts(3); $blog = new Blog($post1,$post2,$post3); var_dump($blog->has_posts); //null foreach($blog->has_posts as $post){ //Invalid argument supplied for foreach() echo $post->b; } But as you see, has_posts is null, not an object containing other objects. Thanks for response. I have a Soup object in a Bowl object in a Microwave object. The Microwave object has the methods: receiveItem(Bowl $b) cookItem(???) I want the Microwave to be able to set the Soup->temperature but I'm not how to do that? Make sense? TomTees I have this code and Im using a while to fetch all the data where users comments are but i want to change it to fetch only 25 rows at a time and each time it refreshes it fetch's 25 more different rows. Code: [Select] <?php include "../../connect.php"; Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); $username = mysql_real_escape_string($_GET['username']); //If friend is set, then query for it, otherwise return all of the friends comments. $friend = (isset($_GET['friend'])) ? ' AND b.friend = \'' . mysql_real_escape_string($_GET['friend']) . '\' ' : NULL; $sql = "SELECT a.username,a.comment,a.timestamp,a.title,a.picture,a.pic_status,a.pic_url,b.id,c.avatar,c.atimestamp,c.onlinestatus FROM (user_comments as a JOIN accounts as c USING(username))JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $friend AND b.status = 1) ORDER BY a.id DESC"; $result = mysql_query($sql); $user_xml = "<?xml version=\"1.0\"?>\n"; //$user_xml .= "<root>\n"; if(mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $user_xml .= "<comment>\n"; $user_xml .= "<image>" . $row['avatar'] . "</image>\n"; $user_xml .= "<name>" . $row['username'] . "</name>\n"; $user_xml .= "<text>\n"; $user_xml .= "<![CDATA[ ". $row['comment'] ."]]>\n"; $user_xml .= "</text>\n"; $user_xml .= "<time>" . $row['timestamp'] . "</time>\n"; $user_xml .= "<title>" . $row['title'] . "</title>\n"; $user_xml .= "<picture>" . $row['picture'] . "</picture>\n"; $user_xml .= "<status>" . $row['pic_status'] . "</status>\n"; $user_xml .= "<url>" . $row['pic_url'] . "</url>\n"; $user_xml .= "<ntimestamp>" . $row['atimestamp'] . "</ntimestamp>\n"; $user_xml .= "<online>" . $row['onlinestatus'] . "</online>\n"; $user_xml .= "</comment>\n"; } } //$user_xml .= "</root>\n"; echo $user_xml; ?> So i think i can do something like this but im not to sure. just add a if statement Code: [Select] while ($row = mysql_fetch_assoc($result)) { $user_xml .= "<comment>\n"; $user_xml .= "<image>" . $row['avatar'] . "</image>\n"; $user_xml .= "<name>" . $row['username'] . "</name>\n"; $user_xml .= "<text>\n"; $user_xml .= "<![CDATA[ ". $row['comment'] ."]]>\n"; $user_xml .= "</text>\n"; $user_xml .= "<time>" . $row['timestamp'] . "</time>\n"; $user_xml .= "<title>" . $row['title'] . "</title>\n"; $user_xml .= "<picture>" . $row['picture'] . "</picture>\n"; $user_xml .= "<status>" . $row['pic_status'] . "</status>\n"; $user_xml .= "<url>" . $row['pic_url'] . "</url>\n"; $user_xml .= "<ntimestamp>" . $row['atimestamp'] . "</ntimestamp>\n"; $user_xml .= "<online>" . $row['onlinestatus'] . "</online>\n"; $user_xml .= "</comment>\n"; } I only wnat to read 25 comments at a time and when i click a button to read more then it reads 25 more rows but it dose not read the data unless requested... can any one help me? Hi. I am a little confused about PDO, its classes and the general oop aspects of it. If you at the below code:
<?php try { $handler = new PDO('mysql:host=127.0.01;dbname=app', 'root',''); $handlser->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); }catc(PDOException $e) { echo $e->getMessage(): die(); } $query = $handler->query('SELECT * FROM table'); while($r = $query->fetch(PDO::FETCH_OBJ)) { echo $r->message; }What's confusing me is that the fetch method is a method within the PDOSTATEMENT class so how come an object hasn't been created before hand in order to use the method? Furthermore it appears the method is a static method within the PDOSTATEMENT class so how come the double semi colon is being used such as: PDOSTATEMENT::FETCH? Any help would be appreciated. Thanks. Hello, i have a query that returns multiple results but in my php query it only returns the first result...ive been checking google on while loops but still havent gotten it to work...would love if someone could look at it...thanks Code: [Select] // while ($result= mysql_fetch_array($stmt)){ while ($stmt->fetch()) { break; // $stmt->close(); // Return unlock code, encoded with JSON $result[] = array( "l_name"=>$l_name, "f_name"=>$f_name, "birth"=>$birth, "expires"=>$expires, ); sendResponse(200, json_encode($result)); return true; sendResponse(400, 'Invalid request'); return false Okay so, I have always been curious, just never have taken the time to ask someone / learn what the differences are in fetches. What does mysql_fetch_array and mysql_fetch_row do thats different from each other? When pulling data from the database, would I like fetch array, or fetch row? or even fetch assoc? Thanks! Guys i badly need need to add paging in this . 20 records per page how to accomplish ? Code: [Select] <?php ini_set ("display_errors", "1"); error_reporting(E_ALL); $http = 'myurl.com/other.php?like=' ; $conn=odbc_connect('apple','',''); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * FROM mytable "; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} echo "<table border= 1><tr>"; echo "<th>ID</th>"; echo "<th>Like</th>"; echo "<th>title</th></tr>"; while (odbc_fetch_row($rs)) { $ids=odbc_result($rs,"ID"); // $links=odbc_result($rs,"links"); $title=odbc_result($rs,"title"); echo "<tr><td>$ids</td>"; echo "<td><fb:like href=\"{$http}{$ids}\" layout=\"button_count\" show_faces=\"false\" width=\"100\" font=\"tahoma\" colorscheme=\"dark\"></fb:like> </td>"; echo "<td>$title</td></tr>"; } echo "</table>"; odbc_close($conn); ?> Hi all, I'm new to PHP have written some code to extract data from mysql. here it is <!DOCTYPE html> <html lang="en"> result 1.png 18.34KB 0 downloads result 2.png 24.62KB 0 downloads Table.png 4.61KB 0 downloads <head> <meta charset="utf-8" /> <title></title> </head> <body> <?php echo "Testing Database....<br>"; $con = mysqli_connect('localhost', 'db_id', 'my_pw', 'mysql_db'); $result = $con->query("SELECT user_id FROM users"); echo "Number of users : ".$result->num_rows."<br><br>"; $row = mysqli_fetch_row($result); echo $row[0]."<br>"; echo $row[1]."<br>"; echo $row[2]."<br>"; ?> </body> </html> in result number of rows its giving right, but when i fetch the result in row, its giving only first row. rest all are empty. then further i have tested few more things like, i change the query as below 'SELECT * FROM users' now this is giving another strange result. It selected first row of the table and making array for all available columns. i have attached herewith image of my table, and result of both of my queries. Could someone guide me on this issue... Hi I got a different and typical (for me) requirement from client. Client have a mobile. He will upload XML file from his mobile to my web address (http://111.111.111.111:8080/directoryname/ In my web address, i have to fetch that request (means take XML file) and insert those details into database by using php. Can anyone tell me how can i do this? |