1

I am using this code to pull data from my database but it is not working. Any ideas?

Code:
<?php

$db = new mysqli($host,$user,$pass,$name);

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}
    $query = "SELECT * FROM Sublist WHERE 1 LIMIT 0 , 30";
    $result = $mysqli->query($query);

while($info = mysql_fetch_array($query,  MYSQL_ASSOC)) {
echo $info['scheduled_date'];
echo "<br>";
echo $info['customer_name'];
echo "<br>";
echo $info['status'];
echo "<br>";
echo $info['kaspersky_template'];
echo "<br>";
echo $info['pcpickup_template'];

 } 
?>

Error code: Fatal error: Call to a member function query() on a non-object in /home/projectu/public_html/sub/scheduled.php on line 20

0

1 Answer 1

2

Don't you mean

$result = $db->query($query);

Followed by

while ($info = mysqli_fetch_array($result)) {
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.