0

I have the following code:

$sql_query = "insert into table students('aarthi','abinesh','anand','aprna','babyshalini','bharathi','dinesh','dhivya','gayathri','gnanaprakash','gokila','gowthem','ibrahim','inbavalli','joemoantom','karthikeyan','kavya','kiruthika','madhumitha','mouliya','nandhini','nithya','prasanth','praveenkumar','priyanga','rajashri','rajkumar','rangashree','reshma','rohan','roja','sangavi','sinthuja','sivasanker_m','sivasanker_v','sowdeshwaran','sowmiya','subash','tamilvalavan','vaishnavi','vasanthakumar','aarchana','dhayalakumaran_sabeesan','premkumar') values ('$m1','$m2','$m3','$m4','$m5','$m6','$m7','$m8','$m9','$m10','$m11','$m12','$m13','$m14','$m15','$m16','$m17','$m18','$m19','$m20','$m21','$m22','$m23','$m24','$m25','$m26','$m27','$m28','$m29','$m30','$m31','$m32','$m33','$m34','$m35','$m36','$m37','$m38','$m39','$m40','$m41','$m42','$m43','$m44')";
mysqli_query($db_select,$sql_query);

It shows the following error:

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\Program Files\EasyPHP-Devserver-17\eds-www\mark\upload.php on line 51

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

-1

The problem is from $db_select you should post it to see what is that you can see mysqli doc to see more: http://php.net/manual/en/mysqli.query.php

look at $link in below example.

<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

/* Create table doesn't return a resultset */
if (mysqli_query($link, "CREATE TEMPORARY TABLE myCity LIKE City") === TRUE) {
    printf("Table myCity successfully created.\n");
}
sajad abbasi
  • 1,988
  • 2
  • 22
  • 43