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 :: running a laravel app locally 
Php :: store as real file name laravel uplaod 
Php :: array_search in php 
Php :: laravel blade route redirect back 
Php :: laravel validation max string length 
Php :: running laravel project in mobile phone 
Php :: array to string conversion in php 
Php :: raw query in laravel with parameters 
Php :: replace all numbers in string php 
Php :: php foreach mysql result 
Php :: migration status php 
Php :: how to redirect a particular user role to a page after login laravel 
Php :: how to get the average in sql in php 
Php :: laravel validate max file size 
Php :: laravel serve in another post 
Php :: get current route in blade laravel 
Php :: php array length 
Php :: how to create a logout button in wordpress 
Php :: taxonomy acf 
Php :: php all date formats 
Php :: php shell script 
Php :: laravel make directory 
Php :: explode in laravel blade 
Php :: how to display the responce of curl in php 
Php :: php unset array element 
Php :: woocommerce order get_data() 
Php :: Class "AppUser" not found 
Php :: mysql_fetch_array php 
Php :: php undefined function split 
Php :: delete record using laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =