Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 572 Vote(s) - 3.63 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple check for SELECT query empty result

#11
SELECT * FROM service s WHERE s.service_id = ?;
IF @@rowcount = 0
begin
select 'no data'
end
Reply

#12
`SELECT count(*) as CountThis ....`

Then you can compare it as string like so:

IF CHECKROW_RS("CountThis")="0" THEN ...

`CHECKROW_RS` is an object
Reply

#13
well there is a way to do it a little more code but really effective

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

$sql = "SELECT * FROM messages"; //your query
$result=$connvar->query($sql); //$connvar is the connection variable
$flag=0;
while($rows2=mysqli_fetch_assoc($result2))
{ $flag++;}

if($flag==0){no rows selected;}
else{
echo $flag." "."rows are selected"
}

<!-- end snippet -->


Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through