Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\wamp64\www\updatemob.php on line 24

When I run the code, this error message is given. I did not fix the problem

Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\wamp64\www\updatemob.php on line 24

$ Code12=$ _POST[‘Code’];

$  Source12=$  _POST['Source'];  $  Destination12=$  _POST['Destination'];  $  StartDate12=$  _POST['StartDate'];  $  EndDate12=$  _POST['EndDate'];  $  RisingTime12=$  _POST['RisingTime'];  $  ClearedTime12=$  _POST['ClearedTime'];  $  Duration12=$  _POST['Duration'];  $  Description12=$  _POST['Description'];  $  Option112=$  _POST['Option1 '];  $  Option212=$  _POST['Option2']; 

$ update = mysqli_query(“UPDATE tablefail SET

code=’$ Code12′,Source=’$ Source12′,Destination=’$ Destination12′,

StartDate=’$ StartDate12′,EndDate=’$ EndDate12′,RisingTime=’$ RisingTime12′,

ClearedTime=’$ ClearedTime12′ WHERE code=’$ Code12′”)

or die(mysql_error());

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given (PHP)

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given

Все статьи пересмотрел, не помогло. Первоначальный код такой:

$  row = mysqli_fetch_array($  result); 

Какой второй должен быть параметр чтобы ошибка ушла?

Warning: imagedestroy() expects parameter 1 to be resource

I am trying to create a code for CAPTCHA generation and here is a first part of my code:

    <?php      $  flag = 5;      if (isset($  _POST["flag"])) //  check that POST variable is not empty     {         $  input = $  _POST["input"];         $  flag = $  _POST["flag"];     }      if ($  flag == 1) // submit has been clicked     {         if (isset($  _SESSION['captcha_string']) && $  input == $  _SESSION['captcha_string']) // user input and captcha string are same         {              ?>              <div style="text-align:center;">                 <h1>Your answer is correct!</h1>                  <form action=" <?php echo $  _SERVER['PHP_SELF']; ?>" method="POST"> // refresh the page                     <input type="submit" value="refresh the page">                 </form>             </div>      <?php          } else // incorrect answer, captcha shown again         {              ?>             <div style="text-align:center;">                 <h1>Your answer is incorrect!<br>please try again </h1>             </div>             <?php             //!!!!!!13. On refresh of CAPTCHA or web site destroy the CAPTCHA. Delete “CAPTCHA.jpeg” file.             imagedestroy('C:\xampp\htdocs\CAPTCHA2\Images\CAPTCHA.jpg');             create_image();             display();         }  } else // page has just been loaded {     create_image();     display(); } 

I did some research but I can’t seem to know what the problem is. Here are the warnings that came up when i tried inputting the CAPTCHA:

Notice: Undefined index: input in C:\xampp\htdocs\CAPTCHA2\latest.php on line 33

Warning: imagedestroy() expects parameter 1 to be resource, string given in C:\xampp\htdocs\CAPTCHA2\latest.php on line 63

Below is the function for creating the image of CAPTCHA

    function  create_image() {     $  fonts = array( dirname(__FILE__) . '/Fonts/arial.ttf',  dirname(__FILE__) . '/Fonts/consolaz.ttf',  dirname(__FILE__) . '/Fonts/kenyc.ttf');     $  word = '';     $  w = 280;     $  h = 120;     $  matrix_c = 240/3;     $  matrix_h = 110/3;      //!!!!!!!2. Create 2 dimensional w*h rectangle.     $  image2 = imagecreatetruecolor($  w, $  h);      $  background_color = imagecolorallocate($  image2, 255, 255, 255);       imagefilledrectangle($  image2,0,0,$  w,$  h,$  background_color);       //!!!!!!!3. Add transparent background in rectangle. With w width and h height so its fit to rectangle.     imagealphablending($  image2, false);      $  transparency = imagecolorallocatealpha($  image2, 0, 0, 0, 127);     imagefill($  image2, 0, 0, $  transparency);     imagesavealpha($  image2, true);       //!!!!!!!4. Take random letter and number from "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" and generate one n number String.      //NOTE: But for selecting letters avoid some same type of letters so its not make any confusion to users. Like I/1, 0/O, Q/O, C/G, h/b After removing this letters, select string only from "acdefgijklmnopqrstuvwxyzABCDEFHJKLMNPRSTUVWXYZ23456789"      $  R = rand(0,255);      $  G = rand(0,255);      $  B = rand(0,255);       $  letters = 'ABCYZ2349';     //$  letters = 'acdefgijklmnopqrstuvwxyzABCDEFHJKLMNPRSTUVWXYZ23456789';     $  len = strlen($  letters);     $  letter = $  letters[rand(0, $  len-1)];     $  text_color = imagecolorallocate($  image2, $  R,$  G,$  B);      //!!!!!!!5. That random String put in rectangle on transparent background. Make this string font color black only.     for ($  i = 0; $  i<6;$  i++) {         $  letter = $  letters[rand(0, $  len-1)];         $  R = rand(0,255);          $  G = rand(0,255);          $  B = rand(0,255);          imagettftext($  image2, 38,  GetGrad(), 20+($  i*40), 75, imagecolorallocate($  image2, $  R,$  G,$  B), $  fonts[rand(0,2)], $  letter);         $  word.=$  letter;     }      //!!!!!!!6. Put this rectangle in session     $  _SESSION['captcha_string'] = $  word;      $  out = imagecrop($  image2,['x' => 10, 'y' => 25, 'width' => 240, 'height' => 60]);     $  line_color = imagecolorallocate($  image2, 255, 255, 255);      imagesetthickness ($  image2,1);      for ($  i = 0; $  i<0;$  i++) {         imageline($  image2,0,$  matrix_h,280,$  matrix_h,$  line_color);         imageline($  image2,0,$  matrix_h*2,280,$  matrix_h*2,$  line_color);         imageline($  image2,$  matrix_c,0,$  matrix_c,120,$  line_color);         imageline($  image2,$  matrix_c*2,0,$  matrix_c*2,120,$  line_color);     }      $  images = glob("*.png");     foreach($  images as $  image_to_delete)     {         unlink($  image_to_delete);           }      //!!!!!!!7. Now give random rotation on that all letters and re-arrange in rectangle.     imagepng($  image2, 'C:\xampp\htdocs\CAPTCHA2\Images\image2.png');     $  image = new imagick( 'C:\xampp\htdocs\CAPTCHA2\Images\image2.png' );     $  distort = array( 10,0,10,0, 0,100, 20,100, 10,250, 20,200,     253,240, 133,190, 266,400, 266,400, 266,100, 246,100,     266,10, 266,0, 133,0, 153,20 );     $  image->setImageVirtualPixelMethod( imagick::VIRTUALPIXELMETHOD_BACKGROUND );     $  image->distortImage( Imagick::DISTORTION_SHEPARDS, $  distort, true  );       $  image->writeImage('C:\xampp\htdocs\CAPTCHA2\Images\image2.png');      //!!!!!!!8. Now divide rectangle in r*c matrix.     imageline($  image2,0,$  matrix_h,280,$  matrix_h,$  line_color);     imageline($  image2,0,$  matrix_h*2,280,$  matrix_h*2,$  line_color);     imageline($  image2,$  matrix_c,0,$  matrix_c,120,$  line_color);     imageline($  image2,$  matrix_c*2,0,$  matrix_c*2,120,$  line_color);      //!!!!!!!10. Insert one background that consist black color’s n number of lines.     $  png = imagecreatefrompng('C:\xampp\htdocs\CAPTCHA2\Images\image2.png');     $  jpeg = imagecreatefromjpeg('C:\xampp\htdocs\CAPTCHA2\Images\bg2.jpg');      $  out = imagecreatetruecolor($  w, $  h);      //!!!!!!!11. Insert this background in Rectangle     imagecopyresampled($  out, $  jpeg, 0, 0, 0, 0, $  w, $  h, $  w, $  h);     imagecopyresampled($  out, $  png, 0, 0, 0, 0, $  w, $  h, $  w, $  h);        $  out = imagecrop($  out,['x' => 10, 'y' => 25, 'width' => 240, 'height' => 60]);       //!!!!!!!12.Export as jpeg file name: “CAPTCHA.jpeg”     imagejpeg($  out, 'C:\xampp\htdocs\CAPTCHA2\Images\CAPTCHA.jpg');  } 

I just started to learn php recently, any help is very much appreciated. Thanks.

Warning: mysqli_query() expects parameter 1 to be mysqli, string give

No se encuentra el servidor”); //obtenemos los valores del formulario $ NombreCompleto = $ _POST[‘NombreCompleto’]; $ Apellidos = $ _POST[‘Apellidos’]; $ Gmail = $ _POST[‘Gmail’]; $ Password = $ _POST[‘Password’]; $ Confirmar = $ _POST[‘Confirmar’]; //Obtiene la longitus de un string $ req = (strlen($ NombreCompleto)*strlen($ Apellidos)*strlen($ Gmail)*strlen($ Password)*strlen($ Confirmar)) or die(“No se han llenado todos los campos”); //se confirma la contraseña if ($ Password != $ Confirmar) { die(‘Las contraseñas no coinciden, Verifique
Volver’); } //se encripta la contraseña $ Password = md5($ Password); //ingresamos la informacion a la base de datos mysqli_query(“INSERT INTO datos VALUES(”,’$ NombreCompleto’,’$ Apellidos’,’$ Gmail’,’$ Password’)”,$ link) or die(“

Error Guardando los datos

“); echo’ alert(“Registro Exitoso”); location.href=”index.html”; ‘ ?>No se encuentra el servidor”); //obtenemos los valores del formulario $ NombreCompleto = $ _POST[‘NombreCompleto’]; $ Apellidos = $ _POST[‘Apellidos’]; $ Gmail = $ _POST[‘Gmail’]; $ Password = $ _POST[‘Password’]; $ Confirmar = $ _POST[‘Confirmar’]; //Obtiene la longitus de un string $ req = (strlen($ NombreCompleto)*strlen($ Apellidos)*strlen($ Gmail)*strlen($ Password)*strlen($ Confirmar)) or die(“No se han llenado todos los campos”); //se confirma la contraseña if ($ Password != $ Confirmar) { die(‘Las contraseñas no coinciden, Verifique
Volver’); } //se encripta la contraseña $ Password = md5($ Password); //ingresamos la informacion a la base de datos mysqli_query(“INSERT INTO datos VALUES(”,’$ NombreCompleto’,’$ Apellidos’,’$ Gmail’,’$ Password’)”,$ link) or die(“

Error Guardando los datos

“); echo’ alert(“Registro Exitoso”); location.href=”index.html”; ‘ ?>

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\Unicornio\produto_detalhe.php on line 11 [duplicada]

Esta pergunta já tem uma resposta aqui:

  • Mysqli_fetch_row() expects parameter 1 to be mysqli_result [fechada] 4 respostas

Produto | Unicornio

<div class="flex container">     <div class="flex-cabecalho">         <div style="flex-grow:1">             <img src="img/Menu.png" height="45px">             <a href="index.php"><img src="img/Logo.png" height="45px"></a>         </div>         <div style="flex-grow: 9">             <?php                 if(isset($  _SESSION['loginCliente']) && $  _SESSION['loginCliente']){                     echo "<a href='login.php'><img src='img/Usuario.png' height=45px'></a>";                 }else {                     echo "<a href='login.php'><img src='img/Usuario.png' height='45px'></a>";                    }             ?>             <?php                 if(isset($  _SESSION['loginCliente']) && $  _SESSION['loginCliente']){                     echo"<a href='carrinho.php'><img src='img/Carrinho.png' height='45px'></a>";                 }else {                     echo '';                 }             ?>         </div>     </div>         <div class="flex-cabecalho">             <div id="divBusca">                 <form>                     <input type="search" placeholder="Search" name="busca">                 </form>             </div>         </div>         <br>         <hr>                 <div>                 <center>                 <img src="produtos/<?php echo $  produto['id'];?>.jpg" height="300px" width="300px">                 </center>             </div>             <div>                 <center>                 <p class="nome-produto">                              <?php echo $  produto['nome']?>                 </p>                 <p class="preco-real">                              de <?php echo "R$  ". $  produto['preco'] ?>                 </p>                 <p class="preco-comdesconto">                            por <?php echo"R$  ". $  produto['preco']*.9  ?>                 </p>                 <p class="preco-parcelado">                              Ou em até 10x de <?php echo "R$  ". $  produto['preco']/10  ?>                 </p>         <hr>                 <p class="descricao">                     <?php echo $  produto['descricao']?>                 </p>                  <?php if(isset($  _SESSION['loginCliente']) && $  _SESSION['loginCliente']) { ?>                     <p class="comprar">                         <a href="comprar.php?idProduto=<?php echo $  produto['id'];?>">Comprar</a>                     </p>                 <?php }else { ?>                     <p class="comprar">                         <a href="cadastro-login?idProduto=<?php echo $  produto['id'];?>">Comprar</a>                     </p>                 <?php }?>                 </center>             </div>     <div class="flex-rodape">         <p><a href="index.php"> Página Inicial</a></p>         <p><a href="cadastro-login.php"> Acesse sua conta </a></p>         <p><a href="carrinho.php"> Carrinho de compras </a></p>         <p><a href="index.php"> Produtos em promoção </a></p>         <p><a href="index.php"> Produtos da loja </a></p>         <p><a href="sobre.php"> Sobre a loja </a></p>     </div>     <div class="flex-rodape-social">         <p><a href="https://www.facebook.com"><img/ src=redes_sociais/facebook.png height="50px"></a></p>         <p><a href="https://www.instagram.com/?hl=pt-br"><img/ src="redes_sociais/instagram.png" height="50px"></a></p>         <p><a href="https://twitter.com/login?lang=pt"><img/ src="redes_sociais/twitter.png" height="50px"></a></p>         <p><a href="https://www.youtube.com/"><img/ src="redes_sociais/youtube.png" height="50px"></a></p>         <p><a href="https://mail.google.com/mail/u/0/"><img/ src="redes_sociais/e-mail.png" height="50px"></a></p>     </div>     <div class="flex-rodape">         <p align="center"> Unicórnio Papelaria</p>         <p align="center"> Telefone: 998456573</p>         <p align="center"> CNPJ: 99.999.999/9999-99</p>         <p align="center"> Endereço: Rua José Antônio N°1234</p>     </div> 

Esse é o meu codigo e esta dando erro sempre

Search Plugin expects different date format in DB – workaround?

I have two plugins: Events Manager and Search & Filter

First one stores dates as YYYY-MM-DD in database, second expects YYYYMMDD format.

What would be an easy workaround to get this working?

First Idea was to let the Events Manager plugin write the date in the correct format in another database table. But I don’t really know where to start.

I know it would be a better solution to get one of the Plugin Developers to support either format – but it seems this won’t happen.