Category : sql

For some reason my code inserts 2 rows instead of one (I’m using PHP & mySQL and my db is powered by PHPMyAdmin). I’m also using prepared statements Code: $sql = "INSERT INTO `subscribers`(`email`) VALUES (?)"; $stmt = mysqli_stmt_init($conn); if (mysqli_stmt_prepare($stmt, $sql)) { mysqli_stmt_bind_param($stmt, "s", $email); mysqli_stmt_execute($stmt); header("Location: https://mywebsite.com/?success=em#sub"); exit(); } else { die(); header("Location: ..

Read more

I’m trying to create a template that fetches a row of data from a database based on the URL variables ?=1&?b=siteurl for example. when http://www.example.com/?a=1&?b=siteurl is visited, I’d like to display all of the information from that specific row, example- the title. $id = $_GET[‘a’]; $dp = $_GET[‘b’]; $stmt = $mysqli->prepare( "select option_id,option_name,option_value from tablename ..

Read more

$query =mysqli_query($con,"select * from table where countRow>’0′ and timerRow=’0′ and userid=’$userid’ limit 1"); if(mysqli_num_rows($query)>0){ return true; } else{ return false; } i want to make PDO to fast connection that i want. it’s because my site is exceed for many users. so anybody can help me for this? Sourc..

Read more

I’m trying to display generated data from PHPMyAdmin into a table using MySQLi and I can’t seem to figure it out. <tr> <th scope="col">Link</th> <th scope="col">Category</th> </tr> <?php //Connection Information $connection = mysqli_connect(‘localhost’,’root’,”); //establish connection to db $selected = mysqli_select_db($connection, ‘sample’); //select db //SQLi Statements $viewQuery = "select * from link JOIN categories"; $execute = ..

Read more