Jump to content

Need a little help with some code from a more experienced php coder


PHPlandman

Recommended Posts

Hello there i need a little help as im very new to php and i need a little help on something. I need some code that will display an error message or a html form depending on what is or isnt in the `value` feild of a table in a mysql database

 

and these are the values i have to use in the table of the mysql database. Well the ones i wish to use anyway

 

`user_id``value``created_at`

 

these are the total that can be used

 

`id``field_id``user_id``value``created_at`

 

What it is i want to do is if the value of `value` is empty show a html form and if the value of `value` has data in it then show/echo an error message that i can use a CSS <DIV> class in saying "Sorry you already have `value` that you created on `created_at`

 

Thanks for the help in advance!  ::)

 

 

$query = "SELECT `value` FROM your_table WHERE .......";
$query_result = mysql_query($query) or die(mysql_error().' on line '.__LINE__);
if(mysql_num_rows($query_result) > 0)

echo "error"...........................


else echo "<input type...............

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.