Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db_con = @new mysqli( 'localhost', 'root', '', 'ImgBox_db' );
- $user_id = $_SESSION['user_id'];
- $user_content_id = "SELECT COUNT(user_id) FROM content WHERE user_id = '$user_id'";
- $count = mysqli_query( $db_con, $user_content_id );
- $count=$dbh->query("SELECT COUNT(user_id) FROM content WHERE user_id = '$user_id'")->fetchColumn();
- public function connectdb($db_name, $db_user, $db_pass, $db_host = "localhost")
- {
- try {
- $this->db = new pdo("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);
- } catch (pdoexception $e) {
- echo "database error: " . $e->getmessage();
- die();
- }
- $this->db->query('set names utf8');
- return $this;
- }
Add Comment
Please, Sign In to add comment