Document Number Tracking System

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sun Sep 16, 2012 8:29 pm

Document Number Tracking System

Postby twinkenny » Sun Sep 16, 2012 8:57 pm

Hello fellow programmers, is nice to find a peaceful and lovely place like this and i hope knowing you the more will bring us more blessings and Fulfillment. I need your help to help me figure out exactly what i was doing wrong. paste the code below this article this project, am just a newbie in the arena of PHP programming and is a bit confusing and is my Industrial Attachment project. The aims is to fetch the matching column from <form value> in mySQL Database table and display the corresponding row in HTML table format this is how far i can go please "what i get is database and table not exist"

$min_length = 11;
// you can set minimum length of the query if you want

if(strlen($search) >= $min_length)
{ // if query length is more or equal minimum length then

$search = htmlspecialchars($search);
// changes characters used in html to their equivalents, for example: < to &gt;

$search = mysql_real_escape_string($search);
function fnValidateAlphanumeric($search)
return ctype_alnum ($search);
// makes sure nobody uses SQL injection
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css"/>
<form method="POST" name="" action="index.php">
<table width="332" border="0" align="center">
<td width="265">
<td width="57">&nbsp;</td>
<td colspan="2">Name:
<input name="search" type="text">
<td colspan="2"><input type="submit" value="Submit" name='submit'></td>
$query="SELECT cid, blnumber, vesnamevge, pofdischg, pofdischg, dateofdischg FROM trackrecord WHERE blnumer='$search'";
echo mysql_error();

<table border="1" cellspacing="2" cellpadding="2">
<tr bgcolor="#6699CC" height=10px >
<td align="left"><font face="Arial, Helvetica, sans-serif">|Bill Number| </font></td>
<td><font face="Arial, Helvetica, sans-serif">|Vessel Voyage Name|</font></td>
<td><font face="Arial, Helvetica, sans-serif"></font>|Place of Discharge|</td>
<td><font face="Arial, Helvetica, sans-serif"></font>|Date of Discharge|</td>
<td><font face="Arial, Helvetica, sans-serif">|Updates|</font></td>

while ($i < $num) {


<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"></font></td>


Save as connection.php

$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "trackingsystem";
$prefix = "";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
mysql_select_db($mysql_database, $bd) or die("Could not select database");

Thanks and God bless you

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest