\n";
echo "Record info will go here \n";
/* MySQL connection */
$gaSql['user'] = "xxxxxxx";
$gaSql['password'] = "xxxxxxxx";
$gaSql['db'] = "xxxxxx";
$gaSql['server'] = "localhost";
$gaSql['type'] = "mysql";
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
die( 'Could not open connection to server' );
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
die( 'Could not select database '. $gaSql['db'] );
// OLD: $sql = "SELECT id,date_last_updated, description,note,account_owner FROM contacts_personal_notes WHERE `account_owner`='".$_SESSION['user_name']."' AND `contact_id`='".trim($_REQUEST['id'], ",")."' $where $sort $limit";
// note i didn't know where $where etc were coming from, you may need to alter this again to fit your exact requirements
$sql = "SELECT id, date_last_updated, description, note, account_owner FROM contacts_personal_notes WHERE 'account_owner'='".$_SESSION['user_name']."' AND 'contact_id'='".trim($_REQUEST['id'], ",")."' ORDER BY $sort LIMIT $limit";//
$result = mysql_query($sql) or die (mysql_errno($connect) . ": " . mysql_error($connect));
$numRows=mysql_num_rows($result);
if($numRows > 0)
{
$row=mysql_fetch_row($result); // can be used if only ever expecting one row to be returned
echo "id: ".$row[0]." ";
echo "date: ".$row[1]." ";
echo "description: ".$row[2]." "; // do 'addslashes' later once this is verified as working
echo "note: ".$row[3]." ";
echo "owner: ".$row[4]." ";
}
else
{
echo "No results found. ";
}
echo " all done";
mysql_close();
?>
|