Monday, 15 September 2014

php - How to connect to database and get custom data in Phorum? -



php - How to connect to database and get custom data in Phorum? -

i using external authentication system. therefore, there lot of user data, not available in phorum.

i using lastly post module, although want info lastly post user, own user table (i have data, avatar, birth info etc). want show in phorum. how can accomplish this?

i've tried connect via a: mysql_query(); no database selected error.

i've searched hours - cannot find documentation regarding getting custom info own user table.

i recommend using mysqli, mysql deprecated. first create sure connection correct. no database selected means not have connection included @ top.

$con = mysqli_connect("localhost","username","password","database"); if (mysqli_connect_errno()) { echo "failed connect mysql: ".mysqli_connect_error()); }

make sure sql statement looks (notice $con in mysqli_query()):

$sql = "select * tablename"; if ($que = mysqli_query($con, $sql)) { // query has ran }

php mysql

No comments:

Post a Comment