Removing table

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sat Apr 19, 2014 4:35 am

Removing table

Postby sidhu7018 » Sat Apr 19, 2014 4:41 am

I downloaded MySQL Table Search script from PhpJabbers I want to remove the below table.I want to display only the given name only demo link :

Code: Select all


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Order Status</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link href="" rel="stylesheet" type="text/css"/>
   font-family:Arial, Helvetica, sans-serif;
<form id="form1" name="form1" method="post" action="search.php">
 <label>Name or Email:</label>
<input type="text" name="string" id="string" value="<?php echo stripcslashes($_REQUEST["string"]); ?>" />

<option value="">--</option>
<input type="submit" name="button" id="button" value="Check Order" />
<br /><br />
<table width="700" border="1" cellspacing="0" cellpadding="4">
    <td width="90" bgcolor="#78be55"><strong>Order Number</strong></td>
    <td width="95" bgcolor="#78be55"><strong>Order Status</strong></td>
    <td width="159" bgcolor="#78be55"><strong>Name</strong></td>
    <td width="191" bgcolor="#78be55"><strong>Email</strong></td>
    <td width="113" bgcolor="#78be55"><strong>City</strong></td>
if ($_REQUEST["string"]<>'') {
   $search_string = " AND (full_name LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%' OR email LIKE '%".mysql_real_escape_string($_REQUEST["string"])."%')";   

if ($_REQUEST["from"]<>'' and $_REQUEST["to"]<>'') {
   $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE from_date >= '".mysql_real_escape_string($_REQUEST["order_id"])."' AND to_date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city;
} else if ($_REQUEST["from"]<>'') {
   $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE from_date >= '".mysql_real_escape_string($_REQUEST["order_id"])."'".$search_string.$search_city;
} else if ($_REQUEST["to"]<>'') {
   $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE to_date <= '".mysql_real_escape_string($_REQUEST["order_status"])."'".$search_string.$search_city;
} else {
   $sql = "SELECT * FROM ".$SETTINGS["data_table"]." WHERE id>0".$search_string.$search_city;

$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
if (mysql_num_rows($sql_result)>0) {
   while ($row = mysql_fetch_assoc($sql_result)) {

    <td><?php echo $row["order_id"]; ?></td>
    <td><?php echo $row["order_status"]; ?></td>
    <td><?php echo $row["full_name"]; ?></td>
    <td><?php echo $row["email"]; ?></td>
    <td><?php echo $row["city"]; ?></td>
} else {
<tr><td colspan="5">No results found in our Database.</td>

Screen shot
screenshot_62.png (27.85 KiB) Viewed 223 times

php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Removing table

Postby seandisanti » Sun Apr 20, 2014 11:50 pm

the short answer is to take out the while loop that executes for every record

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests