Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PHP and MySQL Queries having trouble
TIA to anyone that can help me; I have a little problem and it goes
like this:

I have a php/mysql app that captures telephone calls via user entry,
all works fine except for this - when users check to see if the
caller has called before there is a query that lists previous callers
by using this: --------
query = mysql_query("select `FirstName` , `LastName`
from tracker ORDER BY `FirstName`") or
die(mysql_error());
--------

which when run directly against the db in mysql returns everything
fine but when returned to the web page that calls it in php will not
list those with the same last name or  first name, depending on how I
structure the query.

Here are the relevant pieces of code (in the order that it's
called):

viewclient.php


--------
<?
session_start();
header("Cache-control: private");
if (_SESSION["loggedin"] != 1)
{
echo "Please login before trying to access this script.";
exit();
}
require("include/config.php");
include("templates/header.php");
connection = mysql_connect (host, user,
pass) or die(mysql_error());
mysql_select_db (db) or die
(mysql_error());
query = mysql_query("select `FirstName` , `LastName`
from tracker ORDER BY `FirstName`") or
die(mysql_error());
echo "<form name='frmClient' method='post'
action='clientid.php'>";
echo "<table><tr><td
class='formleft'>Please select a
client:</td>";
echo "<td class='formright'><select
name='client'>";
while (line = mysql_fetch_row(query))
{
if (prev != line[0] &&
prev2 != line[1])
{
_line[0] =
str_replace("

Sponsored Links




Search this forum -> 
Post New Thread

Forum Jump:
All times are GMT. The time now is 04:42 PM.

 

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.