Jump to content

Really basic piece of code for selecting data


NiallThistle

Recommended Posts

There must be something seriously fundamentally wrong with what I'm doing.  I can't even get an individual field to display.  It displays the text saying "Client:" but not the client name I'm looking for.

 

FYI - the url ends with edit.php?action=contract&con=1

 

<?php include("conn.php"); ?>

<?php

$action = $_GET["action"];

// Amend a contract

if($action == "contract")

{
echo"Client:";

$get_client = mysql_query("
SELECT C.client_name as clientname
FROM val_clients C, val_contracts T
WHERE T.contract_id = '".$_GET["con"]."'
AND C.client_id = T.contracts_client
",$objConnect);

while($data = mysql_fetch_array($get_client))
{
echo"$data[clientname]";
}

}

else
{
echo"";
}

?>

 

Someone put me out of my misery!`

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.