Joining tables on different databases, while bindingValues

169
December 02, 2017, at 11:55 AM

I'm trying to update a table with info from boundValues. Except for the city_id. I need to use the city from the boundValue to get its associated city_id from x

$stmt = $this->db->prepare(
                "
                UPDATE x_addresses
                INNER JOIN x ON x = x...
                SET
                    customer_id = :userId,
                    first_name = :firstname,
                    last_name = :lastname,
                    state = :state,
                    company_name = :company,
                    street1 = :street1,
                    street2 = :street2,
                    postal = :postalCode,
                    country = :country,
                    city = :city,
                    city_id = x,
                    region = :region,
                WHERE customer_id = $id
            "
            );
Answer 1

You cant access table column value, unless you have not selected it. In here you can just have update to make sure that this label exists, but you cant select value, you have to do different database query for that.

e.g.

select dbCore.locations_zones_cities.city_id from table where x
update x
Rent Charter Buses Company
READ ALSO
Send User to sub domain using php [on hold]

Send User to sub domain using php [on hold]

using PHP how can I add a link to a users landing page to then send them to a sub domain?

176
Handshake error to mysql via ssl

Handshake error to mysql via ssl

tldr: I get the following error with a client/server setup with ssl:

553
mysql delete query is happening prematurely

mysql delete query is happening prematurely

I have a query on my page that retrieves information from the database about rows, adds the values and returns the information

230
can someone help me with this mysql code [on hold]

can someone help me with this mysql code [on hold]

I'm trying to insert some data , but it doesn't work, I´m learning databases with SQL

146