Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,228 members, 7,815,293 topics. Date: Thursday, 02 May 2024 at 10:19 AM

How To Reconfigure Database Connection - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Reconfigure Database Connection (1071 Views)

How To Block Internet Connection For Coreldraw / Design Websites With Only Your Smartphone - No Laptop Or Internet Connection (2) (3) (4)

(1) (Reply) (Go Down)

How To Reconfigure Database Connection by skyhighweb(m): 11:56am On May 19, 2017
this: $country_result = $conn->query("SELECT b.auction, a.id FROM " . $DBPrefix . "vs_auctions a

connect to this database

<?php
$conn = new mysqli('localhost', 'root', 'pass', 'db');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>

while these: $query = "SELECT a.id, b.auction FROM " . $DBPrefix . "auctions a

connect to this database

<?php
$DbHost = "localhost";
$DbDatabase = "db";
$DbUser = "root";
$DbPassword = "pass";
$DBPrefix = "vs_";
$main_path = "grin:\\xampp\\htdocs\\vset\\";
$MD5_PREFIX = "ca801ec4f5c664bc6a492f942b3a07eb";
?>


how do i rewrite this
$country_result = $conn->query to work like this $query =
Re: How To Reconfigure Database Connection by Successguilders: 2:46pm On May 29, 2017
Mysqli_querry($conn, "SELECT * ...")
Re: How To Reconfigure Database Connection by webdeveloperqx: 2:53pm On May 30, 2017
skyhighweb:
this: $country_result = $conn->query("SELECT b.auction, a.id FROM " . $DBPrefix . "vs_auctions a

connect to this database

<?php
$conn = new mysqli('localhost', 'root', 'pass', 'db');
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>

while these: $query = "SELECT a.id, b.auction FROM " . $DBPrefix . "auctions a

connect to this database

<?php
$DbHost = "localhost";
$DbDatabase = "db";
$DbUser = "root";
$DbPassword = "pass";
$DBPrefix = "vs_";
$main_path = "grin:\\xampp\\htdocs\\vset\\";
$MD5_PREFIX = "ca801ec4f5c664bc6a492f942b3a07eb";
?>


how do i rewrite this
$country_result = $conn->query to work like this $query =


<?php

//make your connection like this

$conn = new Mysqli(//pass your arguments); //$conn holds an instance of the Mysqli Class . so from the class, you can easily call the methods
//you need

//query
$query = "SELECT b.auction, a.id FROM table_name"

//to execute the query

$conn->query($query);

//you can also store the response returned in a variable like so

$selected = $conn->query($query);
?>
Re: How To Reconfigure Database Connection by Keeppushing: 8:59am On May 31, 2017
Are you in Lagos and You need to learn and get certified in this modular courses:
A+
N+
MCSA
WED DESIGN
PMP
MCSE
CCNA
CCNP
IC3
LINUX RHCE V.6
ITIL
ORACLE DBA
ETHICAL HACKING (Certified ethical hacking)
PHP, MYSQL,C#
Kindly call 07036968890 or visit no.77 Ojuelegba Road (second floor), by Ojuelegba bustop

(1) (Reply)

Mlm Script Needed Pls / Android Application Creation: Learn How To Create An Android Application / Web Developer (remote Position)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.