U
U
Uzair Izha2015-11-23 09:47:52
PHP
Uzair Izha, 2015-11-23 09:47:52

How to check the result of a query?

$rs="SELECT * FROM `pany`  WHERE `link`='$link' LIMIT 1";
 $ars =  mysql_query ($rs);

How to make a condition? Well if `link is not equal to `$link'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Finesse, 2015-11-23
@UZEIR

$rs="SELECT * FROM `pany`  WHERE `link`='$link' LIMIT 1";
$ars =  mysql_query ($rs);
if ( mysql_num_rows($ars) )
  echo 'Результат есть';
else
  echo 'Пусто';

M
Mikhail Goryachkin, 2015-11-23
@abaddon65

$rs="SELECT * FROM `pany`  WHERE `link` <> '$link' LIMIT 1";

Or
$rs="SELECT * FROM `pany`  WHERE NOT `link` = '$link' LIMIT 1";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question