Jump to content

LyDev

New Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LyDev

  • Rank
    Newbie
  1. Insert query is there in the code . I need to place select query and an if condn
  2. I have insert in PDO. I need to write a select query before that and get the count of the rows. Based on that I must write an if condition before insert. Below is my code. <?php $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $dbname = "test"; function placeholder( $text, $count = 0, $separator = ',' ) { $result = array(); if ($count > 0) { for ($x = 0; $x < $count; $x++) { $result[] = $text; } } return implode( $separator, $result ); } $pdo = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass); $datafields = array( 'email' => '', '
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.