急求助!!不知道錯在哪裡?

edited 十月 2013 in PHP新手區
小弟用了http://www.corvalis.net/address/的address book

可是更改了search.php
但不知道錯在哪裡
請求各位幫忙!!
謝了.

// goTo functionality
// Search does not work so we'll make it do the same thing as goTo for now.
if ($search) {
$goTo = $search;
}
if ($goTo) {
$gotosql = "SELECT contact.id, contact.fullname, contact.middlename, contact.lastname, contact.type, contact.notes, contact.whoadded
email.email, address.line1, address.line2, address.city, address.state, address.zip, address.country,
address.phone1, address.phone2, otherphone.phone, websites.webpageURL
FROM ". TABLE_CONTACT ." AS contact
LEFT JOIN ". TABLE_EMAIL ." AS email ON contact.id=email.id
LEFT JOIN ". TABLE_ADDRESS ." AS address ON contact.id=address.id
LEFT JOIN ". TABLE_OTHERPHONE ." AS otherphone ON contact.id=otherphone.id
LEFT JOIN ". TABLE_WEBSITES ." AS websites ON contact.id=websites.id
WHERE
CONCAT(firstname,' ', lastname) LIKE '%$goTo%' OR
CONCAT(firstname,' ', middlename,' ', lastname) LIKE '%$goTo%' OR
nickname LIKE '%$goTo%' OR
type LIKE '%$goTo%' OR
notes LIKE '%$goTo%' OR
whoadded LIKE '%$goTo%' OR
email LIKE '%$goTo%' OR
line1 LIKE '%$goTo%' OR
line2 LIKE '%$goTo%' OR
city LIKE '%$goTo%' OR
state LIKE '%$goTo%' OR
zip LIKE '%$goTo%' OR
country LIKE '%$goTo%'
phone1 LIKE '%$goTo%' OR
phone2 LIKE '%$goTo%' OR
phone LIKE '%$goTo%' OR
websites LIKE '%$goTo%'
ORDER BY fullname";

$r_goto = mysql_query($gotosql, $db_link);
$numGoTo = mysql_num_rows($r_goto);

}

原始討論: http://twpug.net/x/modules/newbb/viewtopic.php?topic_id=1824

評論

Sign In or Register to comment.