Jump to content

R3v07v3R

New Members
  • Posts

    2
  • Joined

  • Last visited

R3v07v3R's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That worked perfectly, thank you. I never knew that made a difference.
  2. Hi I am trying to pull data from a MySQL table but it keeps returning some of the PHP code instead of the results. <? $db_server = '127.0.0.1'; $db_usr = 'user123'; $db_pass = '123456'; $db_database = 'test'; $con = mysql_connect($db_server, $db_usr, $db_pass, $db_database); if (!$con) { die('Could not connect: ' . mysql_error()); } $query = "SELECT * FROM bookings WHERE `booking_start` <= NOW( ) ORDER BY booking_start"; $result = mysql_query($query); echo mysql_error(); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $bookingnum = $row['booking_num']; $servernum = $row['server_num']; $usrnum = $row['usr_num']; $start = $row['booking_start']; $end = $row['booking_end']; $creation = $row['booking_made']; echo " <div> bookingnum: $bookingnum<br /> servernum: $servernum<br /> usrnum: $usrnum<br /> start: $start<br /> end: $end<br /> creation: $creation<br /> </div> "; } mysql_close($con); ?> So please tell me if I am missing something, but this is what my query returns. and this is what the MySQL table looks like.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.