Jump to content

comparebest

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by comparebest

  1. Ok, just another noob problem here while working with PHP + MySQL: I have a php page containing a form which I use to pull the data from mysql database. When the user chooses a value/values from the dropdown lists and clicks submit, the page reloads and displaying the quarry results according to user's selection. When user first loads the php page with form, it shows no data unless he clicks submit. Question: How to show a default quarry value on first page load before user even get to use the form? In other words, I want the user to see the default quarry data pulled from DB on page load before he uses the form to refine the results... I am not sure if its possible, but truly hope so I would appreciate any advice or pointer in the right direction. Please let me know if you need the exact code I am using for my form page.
  2. Ok this is some noob question here I have a page that has few separate pieces of php code embeded within html code. Each piece is separated with <?php ... ?> tags, everything works fine. I need to assign a variable in first (from the top) piece of php code. Then I want to be able to use that variable in all others php pieces across this same page.... I searched and searched and first tried to do it like : First piece: <?php function id() { $id="blah"; } ?> Second piece : <?php id(); ... echo $id; ?> didn't work, then I tried First place: <?php $id="blah"; function id() { global $id; } ?> Second piece : <?php echo $id; ?> After struggling and reading for few days all about global, static, and regular variables i finally decided to ask professionals to help.... please let me know if you need me to make the question description more clear or smn
×
×
  • 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.