Search
 
SCRIPT & CODE EXAMPLE
 

PHP

sql row count php pdo


<?php
/* Delete all rows from the FRUIT table */
$del = $dbh->prepare('DELETE FROM fruit');
$del->execute();

/* Return number of rows that were deleted */
print("Return number of rows that were deleted:
");
$count = $del->rowCount();
print("Deleted $count rows.
");
?>

Comment

pdo get row count

// query example
echo $db->query("SELECT * FROM users")->rowCount(); // Will return the total member number.

// prepare example
$query = $db->prepare("SELECT * FROM users WHERE user_username=? && user_password=?");
$query->execute(array($username, md5($password)));

echo $query->rowCount(); // Will return the number of columns affected.
						 // if($query->rowCount() > 0) means there is an user found with given username and password.
Comment

PREVIOUS NEXT
Code Example
Php :: how to create controller in specific folder laravel 
Php :: check input value is integer or not in php 
Php :: php artisan migrate reset 
Php :: wordpress get post time 
Php :: define url wordpress 
Php :: put img in timestamp using php 
Php :: pre_r 
Php :: get all pages list from specific template 
Php :: php laravel xml to json 
Php :: save html form data to text file using php 
Php :: highlight search text in php 
Php :: wp show logo 
Php :: reload page in php 
Php :: get category name by id wordpress 
Php :: check if date between two dates laravel eloquent 
Php :: twig symfony get route 
Php :: convert date in php 
Php :: laravel sum group by 
Php :: get file each line in php 
Php :: for loop php continue to next item 
Php :: wp_mail html content 
Php :: php array_sum 
Php :: php remove last character from string 
Php :: laravel migration set default value 
Php :: get count of relationship table laravel 
Php :: phoenix input type password 
Php :: Search WordPress with custom field 
Php :: foreign key nullable in laravel 
Php :: wordpress embed shortcode in php 
Php :: ternary operator laravel blade 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =