Note that there are some explanatory texts on larger screens.

plurals
  1. POI can not assign the value recived from $_GET[] to a variable
    primarykey
    data
    text
    <p>I am trying to pick the id using the <code>$_GET[]</code> and assign it to a variable however it does not work. when i try to echo <code>$_GET[]</code> directly it works fine the ID is displayed on the page, however when i assign it to a variable and try to echo it, it wont work. for example this wont work: </p> <pre><code>$sel_hotel = $_GET[]; echo $sel_hotel; </code></pre> <p>The code looks fine there is no any problem with it but it just don't pass that value to the variable i believe there may be something wrong with my php.ini file but i am not sure. i am using PHP Version 5.4.3. Please Help . Thank you very Much </p> <pre><code>&lt;?php if(isset($_GET['hotl'])){ $sel_hotel = $_GET['hotl']; $sel_hotel =""; echo $sel_hotel; }elseif(isset($_GET['room'])){ $sel_room = $_GET['room']; $sel_room =""; echo $sel_room; }else{ $sel_hotel =""; $sel_room =""; } echo $sel_hotel; ?&gt; &lt;?php require_once("includes/header.php");?&gt; &lt;?php require_once("includes/function.php");?&gt; &lt;?php //require_once("TheDatabase.php")?&gt; &lt;?php $connection = mysql_connect("localhost","root","root"); if(!$connection){ die("Database Connection Failed :". mysql_error()); }else{ $db_select = mysql_select_db("travelnstay", $connection); if(!$db_select){ die("Database Selection Failed:". mysql_error()); } } ?&gt; &lt;div class="Calign"&gt; &lt;div class="mar"&gt; &lt;div&gt; &lt;p&gt;Menu&lt;/p&gt; &lt;?php $hotel_set = select_all_hotels(); while($hotel = mysql_fetch_array($hotel_set)){ echo "&lt;p class=\"mar\"&gt;&lt;a href=\"admincontent.php?hotl=" . urlencode($hotel["hotel_id"]). "\"&gt;{$hotel["hotel_name"]}&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;"; $room_set = room_by_id($hotel["hotel_id"]); echo "&lt;ul&gt;"; while($room= mysql_fetch_array($room_set)){ echo "&lt;li&gt;&lt;a href=\"admincontent.php?room=". urlencode($room["room_id"]). "\"&gt;{$room["room_type"]}&lt;/a&gt;&lt;/li&gt;"; echo"&lt;/ul&gt;"; } } echo "&lt;p&gt; Its is suppose to be here".$sel_hotel."&lt;/p&gt;"; echo "&lt;p&gt;". $sel_room. "&lt;/p&gt;"; ?&gt; &lt;/div&gt;&lt;!--end of the mar--&gt; &lt;/div&gt;&lt;!--end of the Calign--&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload