PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$select = "SELECT sec.idnum AS 'ID Number', sec.lname AS 'Last Name', secy.fname AS 'First Name' FROM table WHERE (($search) LIKE '%$svalue%')) ORDER BY $order";
?>
can any one explain this query to me specially sec.idum etc, and
(($search)LIKE '%$values%')) ORDER BY $order";
it returns all rows where field $search is like $values and orders that resultset by field $order. All of them are variable, thus can be adjusted based on user input or something. sec.idnum won't work because there's no such table mentioned in FROM clause.
<?php
$select = "SELECT sec.idnum AS 'ID Number', sec.lname AS 'Last Name', secy.fname AS 'First Name' FROM (itable INNER JOIN linktable ON itable.policynumber = linktable.policynumber) INNER JOIN security ON linktable.agentid = sec.idnum WHERE (($search) LIKE '%$svalue%')) ORDER BY $order";
?>
Now this is the complete qyery. please tell me wot sec.idmun means and 2nd thing is
INNER JOIN and , (comma) are semantically equivalent in the absence of a join condition: both will produce a Cartesian product between the specified tables (that is, each and every row in the first table will be joined onto all rows in the second table).