Интервью на работу и MySQL запрос!

buuza
Дата: 27.12.2012 17:17:02
Помогите пожалуйста, сижу на интервью, голова вообще не соображает, мне нужно реализовать простую форму, которая выводит запись из таблицы MYSQL. Вот условия:
есть 2 таблицы:
tblItem: ResNum | itemId
1 | 174

tblBooking: ResNum | Status
1 | ok

нужно вывести Status по введенному itemId.
Например, я ввожу в форме itemId = 174, форма показывает Status = ok
trew
Дата: 27.12.2012 17:23:01
buuza,

SELECT t2.Status
FROM tblItem t1
    INNER JOIN tblBooking t2
    ON t1.ResNum= t2.ResNum
WHERE t1.itemId = 174
buuza
Дата: 27.12.2012 17:30:30
trew
buuza,

SELECT t2.Status
FROM tblItem t1
    INNER JOIN tblBooking t2
    ON t1.ResNum= t2.ResNum
WHERE t1.itemId = 174


Спасибо, щас попробую..
вот задание если интересно))
<?php
require_once("common.php");

/*

There's a table called tblBooking another one called tblItems .

tblBooking has a field called 'Status' and another called 'ResNum'
tblItem has a field called 'ResNum' and another called 'ItemID'





What I need you to create, is a <form> where you input the 'ItemID' and returns the status of the Reservation (located in tblBooking.Status).

There's a function that already connects to the database and returns the results ( sql_cover() ). Use it , It's loaded already in this script



Here are some item id's for you to test: 687863 (shows OK) , 228 (shows CX) , 1020 (shows OK), 174 (shows CX)



*/

//EXAMPLE OF sql_cover USAGE
$query='select * from tblBooking limit 5';
$result = sql_cover($query, "select", 0, 0, 0, 0);
MasterZiv
Дата: 28.12.2012 12:52:32
buuza,

Ну че, прошёл собеседование?
buuza
Дата: 29.12.2012 07:36:19
MasterZiv
buuza,

Ну че, прошёл собеседование?

Да, спасибо, прошел. Просто давно учил и забыл, отправлял себе потихоньку резюмешки пока этот тест не дали)