Re: Inserting databasecontent within the same form

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> How can I overtake the fieldvalues of city and the first part of the
> phonenumber. It should read out the value of the zipfield and check them
> with the content of the table "ort". If there is found a recordset with
> the same plz the formfields city and the the field "vorwahl" should get
> the values of the fields of the recordset.

I'm having troubling understanding exactly what you want  and I don't
have time to decipher all the code in the hope it will tell me.  My best
guess is you want to use the zipcode from one table, to automatically
add the city name into a form from another table.  If that is so, you
can do it with your query using a join.

SELECT Kunden.*, City.name, City.vorwahl FROM Kunden LEFT JOIN City
USING (zipcode)

This assumes that `zipcode` exists in both tables and is unique in the
"City" table.  You should also process the City.name and City.vorwahl
results for NULL results where `zipcode` does not exist in the "City"
table.

--
Niel Archer

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux