How to check if a value is listed in a database using MySQL and PHP? -


I was thinking how I can check whether a web page is listed in a database

How can I do this using PHP and MySQL?

Sorry if I'm ambiguous I'm new to PHP and MySQL.

A simple example.

  & lt; Php $ db = mysql_connect ('host', 'user', 'pass'); $ Sql ​​= "Choose from your URL URL = 'http://example.com/foo'"; $ Qid = mysql_query ($ sql, $ db); If (mysql_num_rows ($ qid) == 0) {$ sql = "Include in your TABLE value ('http://example.com/foo')"; Mysql_query ($ sql, $ db); }  

However after the mysql_connect () and mysql_query () functions you should check the error.

View: and


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -