im working on final year project of my deg its complete finaly i want to show a ticket to be appear after payment which has name and so on.

and a ticket number i want to generate a random ticket number for a user which will appear on the ticket also i have another problem.

which is when ever im resulting number from table its not showing why?

Recommended Answers

All 2 Replies

Can you post your code for generating the ticket number and displaying it please? This might help us figure out where you are going wrong...

i have done this to achive result but tables are mess? i want this to show a ticket look like a ticket havent worked with php styling and tables?

[IMG]http://i42.tinypic.com/2s837tf.jpg[/IMG]

i want this to look like a ticket? what should i do?

<?php
$con = mysql_connect("localhost","root","autodeskmaya");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("online_bus_project", $con);



echo "<table border='1' cellpadding='5' cellspacing='3' align='center' bgcolor='#ececec'>
<tr>

<th>Online Bus Ticket Reservation System - Traveling Ticket</th> 

</tr>";

echo "</table>";



$result3 = mysql_query("SELECT ticket FROM ticket_number ORDER BY RAND() LIMIT 1");


echo "<table border='1' cellpadding='5' cellspacing='3' align='center' >
<tr>

<th>Ticket Number</th> 

</tr>";

while($row3 = mysql_fetch_array($result3))
  {
  echo "<tr>";
  echo "<td>" . $row3['ticket'] . "</td>";
  echo "</tr>";
  }
echo "</table>";







//SELECT * FROM table ORDER BY RAND() LIMIT 1




$result2 = mysql_query("SELECT first_name, last_name FROM user_information ORDER BY `id` DESC LIMIT 1");  


echo "<table border='1' cellpadding='5' cellspacing='3' align='center' >
<tr>

<th>Name</th> 
<th>Last Name</th>




</tr>";

while($row2 = mysql_fetch_array($result2))
  {
  echo "<tr>";
  echo "<td>" . $row2['first_name'] . "</td>";
  echo "<td>" . $row2['last_name'] . "</td>";
  echo "</tr>";
  }
echo "</table>";






$result = mysql_query("SELECT * FROM trip ORDER BY `id` DESC LIMIT 1");  


echo "<table border='1' cellpadding='5' cellspacing='3' align='center' >
<tr>\n
<th>From</th>
<th>To</th>
<th>Date</th>
<th>Paid Amount</th>



</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['gender'] . "</td>";
  echo "<td>" . $row['country'] . "</td>";
  echo "<td>" . $row['date'] . "</td>";
  echo "<td>" . $row['fare'] . "</td>";
  echo "</tr>";
  }
echo "</table>";


$result1 = mysql_query("SELECT * FROM seat ORDER BY `id` DESC LIMIT 1");  


echo "<table border='1' cellpadding='5' cellspacing='3' align='center' >
<tr>\n
<th>Seat</th>

</tr>";

while($row1 = mysql_fetch_array($result1))
  {
  echo "<tr>";
  echo "<td>" . $row1['seat'] . "</td>";
  echo "</tr>";
  }
echo "</table>";








mysql_close($con);
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.