开发者

How do I print the dynamic location for each user using MYSQL

The code

<?
if($items["User"]["city"]!=""){
    echo " ". $items["User"]["city"];
} else {
    echo " Unknown Location";
}
?>

IS working on开发者_开发问答 this page http://www.u.neighborrow.com/requests/view/2183 DISPLAYING THE CORRECT LOCATION = HOUSTON

I PUT THE SAME CODE ON items/view to dynamically pull location... so I modified REQUESTS to ITEMS and put the same code here

but it's not finding the right data.

How can I get UNKNOWN LOCATION to display the CITY in the users table of the owner of the item?


Here are some steps you need to apply

  • Debug the the result
  • Identify the difference
  • Modify accordingly

These simple steps will get you far in the world of computer science


I think you should know what has already been put in the array.you can use the print_r or var_dump functions. then try to go through the array use for or foreach .


I notice the first URL shows the location "houston" in the description text. The second URL attempts to show location in the title, showing Location Unknown instead. The second URL does show a location "NYC" in the description text.

It may be your framework/library does not have the 'city' datum available at the time it is printing the title.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜