1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35:
\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'] ); $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";// //echo "sql: ".$sql."\n"; $result = mysql_query($sql) or die (mysql_errno($connect) . ": " . mysql_error($connect)); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "inside while"; echo "id: ".$row['id'].""; echo "date: ".$row['date_last_updated'].""; echo "discrip: ".addslashes($row['description']).""; echo "note: ".addslashes($row['note']).""; echo "owner: ".addslashes($row['account_owner']).""; } echo "all done"; mysql_close(); ?>
1:
sql: Identifikation, date_last_updated, Beschreibung, Anmerkung, account_owner VORWÄHLEN von den contacts_personal_notes, WO „account_owner `= ' Eric grau“ UND „contact_id `= ' 2“
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 6: 37: 38: 39: 40: 41: 42:
\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(); ?>