saving . . . saved database connected but while executing the query getting some warning message plz check and give replay sir has been deleted. database connected but while executing the query getting some warning message plz check and give replay sir has been hidden .
database connected but while executing the query getting some warning message plz check and give replay sir
Title
Question
<span style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: medium;">connected!</span>
Warning<span style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: medium;">: mysqli_query() expects at least 2 parameters, 1 given in </span>C:\xampp\htdocs\ANUPHP\mysql\mysql.php<span style="color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: medium;"> on line </span>4
<font color="#000000" face="Times New Roman" size="3">code here
</font>
<font color="#000000" face="Times New Roman" size="3">
<?php
require ("connect.php");
$date =("Y-M-D");
$write = mysqli_query("INSERT INTO mydata VALUES(' ','anusha','merugu','$date','female')");
?>

</font>


PHP-and-MySQL MySQL-Part-3 03-04 min 20-30 sec 22-05-20, 4:11 p.m. anushamerugu

Answers:

Dear User,

The mysqli_query function excepts 2 parameters , first variable is mysqli_connect equivalent variable (in our case $connect), second one is the query you have provided.

Try altering your code to following:
<?php
require("connect.php");
$date = date("Y-m-d");
$write = mysqli_query($connect,"INSERT INTO people VALUES('','Alex','Garrett','$date','M')") or die(mysqli_error($connect));
?>


17-01-22, 4:40 p.m. hbammkanti


Log-in to answer to this question.