table:clients
поля: clientId(autoinc/primary), customerId, clientName
table:projects
поля: projectId(autoinc/primary), customerId, projectName
table:items
поля: itemId(autoinc/primary), customerId, itemName
запрос:
Код: Выделить всё
include('includes/conn.inc.php');
$query = "SELECT customerId
FROM items, projects, clients
WHERE customerId= 135";
$stmt = $mysql->prepare ($query);
$stmt->execute();
$stmt->bind_result($customerId);
while($row = $stmt->fetch()) :
echo $customerId;
endwhile; $stmt->close();
ошибка: вызов выполнения для объекта, не являющегося объектом.
Заранее всем спасибо
Подробнее здесь: https://stackoverflow.com/questions/127 ... th-my-join
Мобильная версия