SELECT * from city WHERE city.pname= $row _a[' pname ')
$row _a[' pname ') is a variable of another table, ask if this sentence is feasible, if it is wrong,
Reply to discussion (solution)
There is no such thing as $row _a[' pname ') in MySQL.
Print out this SQL and put it in the database to see if it can be executed.
Your $row_a[' PName ' is from the PHP program, change to this can be carried out, probably
$sql = "SELECT * from the city WHERE city.pname= ' $row _a[' pname ']"; $result =mysql_query ($sql);
If you simply use MySQL, you need to change $row_a[' pname ' to a specific value, such as
SELECT * from city WHERE city.pname= ' A '
Simple SQL can be executed.
You should be a multi-table cross-query.
Data Sheet Row_a
Data Table City
The field pname in table row_a is equal to the field pname in city
So the statement should be written like this:
Select c.* from city as C inner joins Row_a as R on C.pname=r.pname
You can search the inner join, left JOIN, right join basic know