U
U
Uzair Izha2015-10-16 21:14:24
PHP
Uzair Izha, 2015-10-16 21:14:24

How to determine true mysql query?

I have a query $respr1= mysql_query("SELECT * FROM `do65i_k2_items` WHERE a='$a' and b='$b'");
I want to build a condition where you can define a trye or false request, well, that is, if () what to write in brackets ??

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
IceJOKER, 2015-10-16
@IceJOKER

php.net/manual/ru/function.mysql-query.php - there is a warning and an answer to your question, I strongly recommend reading from beginning to end

A
Andrey Raboy, 2015-10-16
@raba

read here habrahabr.ru/post/21376

S
svd71, 2015-10-17
@svd71

There is no unequivocal advice here - everyone goes crazy according to their sexual orientation. Some create domains of a specific type and return values ​​of those specific types.
For how to return a value depending on defined (or vice versa undefined) field values, read this manual https://dev.mysql.com/doc/refman/5.1/en/control-fl...
I most often use a very simple method. I'll rewrite your request for it:
If the query returns a non-zero value, then true. All other cases mean "not true", i.e. false.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question