Lookup data ??

Codes here !

Moderators: macek, egami, gesf

estilo11
New php-forum User
New php-forum User
Posts: 1
Joined: Thu May 24, 2012 12:19 am

Lookup data ??

Postby estilo11 » Thu May 24, 2012 12:25 am

can someone help me with my coding

Code: Select all

<?php
include("config.php");

  $sql='select * from reservasi where username="'.$_SESSION['username'].'" LIMIT 1';
  $sql='select * from reservasi where username="'.$_SESSION['username'].'" LIMIT 1';
  $query=mysql_query($sql);
 
  while($rows=mysql_fetch_array($query))
 
  {?>
 <font color="white" size="+1" style="arial">
      <table style="margin-left:50px;">
     <tr><td>ID Reservasi  </td>
     <td>: </td>
     <td><?php echo $rows['res_id'];?></td></tr></br>
      <tr><td>Username  </td>
     <td>: </td>
     <td><?php echo $rows['username'];?> </td></tr><br>
     <tr>
     <td>Tanggal Reservasi </td>
     <td>: </td>
     <td><?php echo $rows['tanggal'];?></td></tr><br>
      <tr>
      <td>Paket  </td>
      <td>: </td>
      <td><?php echo $rows['package_id'];?></td></tr>
      <tr>
      <td>Venue </td>
      <td>: </td>
      <td>
      <?php
      $temp=$rows1['venue_id'];
      $sql1="select venue_name from venue where venue_id=$temp";
      $query=mysql_query($sql);
      if ($rows1== mysql_fetch_array($query)){
            echo $rows1['venue_id']; ?> </td></tr>
      </table></font>
      <?php }} ?>


this code use to lookup a data in venue table. but in my problem, the venue name wont show up...

can someone help to correct or tell me the wrong part ?

thank you ....

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Lookup data ??

Postby egami » Fri May 25, 2012 4:53 am

You're sure that _SESSION['username'] is a valid variable?

User avatar
Nullsig
php-forum Fan User
php-forum Fan User
Posts: 981
Joined: Thu Feb 17, 2011 6:52 am
Location: Racine, WI

Re: Lookup data ??

Postby Nullsig » Fri May 25, 2012 5:42 am

Have you initialized the session in config.php?

Code: Select all

session_start();


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 2 guests

cron