Jump to content

isset to check varaible


iammudassir

Recommended Posts

i have a field field1 value ="<?php if(isset($_POST['submit'])){echo $row[1]; }?>" $row[1] is result because of a query some times $row[1] is present and some times no if not present it generate an error how i set my php code in value to check after submit is $row[1] is present or not to echo it

Link to comment
Share on other sites

if the query never executed, because the form was never submitted, then $row[1] would never have been set, so why not just check for $row[1]? it might help if you post all of your relevant code.

Link to comment
Share on other sites

actually i want to check both select and $row[1] because when i press select button it will execute a query and $row[1] is the result of that queryso i want to check if select is pressed and my query has $row[1] then echo it
Fine, then check for both of them. My point is that if $row[1] is not set, and you want to avoid that error message, then you need to check if $row[1] is not set. If you want to check more than just that, then go ahead.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...