MySQL Forums
Forum List  »  PHP

Re: require help to include 2 databases in script
Posted by: Peter Brawley
Date: February 04, 2015 10:34PM

> 2 databases on the same server

Simple, just qualify table and column names in your queries, eg db1.tblA.columnnameX.

Also ...

- mysqli connection error info is in mysqli_connect_error()

- specify columns in queries, don't rely on column wildcards like *

- your functions getCountry... &c need access to the connection resource reference $con, either by having it passed in, or by having it declared global inside those funcs.

_ in your procedural style, mysqli_error( $con ) expects a param ref to the connection $con

- before referencing $row[area_name], your code needs to verify that it exists

Your code needs to assume that every possible error can and will occur.

Options: ReplyQuote


Subject
Written By
Posted
Re: require help to include 2 databases in script
February 04, 2015 10:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.