Jump to content

ale8oneboy

Members
  • Posts

    46
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ale8oneboy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Something to think about when deciding to use functions or not - Ask yourself: "Am I about to cut and paste a block of code?" The response should be: "Then maybe I should turn this block of code into a function."
  2. This code: if(@$_POST['state'] == $value) { echo "selected='selected' "; } Is correct/works in comparing the current array entry to what's selected. Logically you want to insert that code on the <option> tag. Break this line: echo "\n<option value='$state_province' /> "; Into: echo "\n<option value='$state_province' "; //insert the code to check the selected value here echo "/> "; How's that work for ya?
  3. The max execute time would come into play as well as other PHP ini variables. Take a look at: max_post_size and upload_max_filesize
  4. If there not a space in the file name then that's your issue. Remove the space on line where it creates the path. The way the script is now it's adding a space. Try changing: $path = '/inc ' .$page .".php"; to $path = '/inc' .$page .".php";
  5. On this line: $path = '/inc ' .$page .".php"; I notice there is a space after "/inc". Does the file to be included have a space in the file name? Is the file in the root of your application? Try to echo out what the path it's concatenating is and verify that the path is correct. It may be just as simple as that space causing issues.
  6. The code you have provided would display the qty, an * and then the price. I believe you're looking for this: echo '<td>'.($_SESSION['itemqty'][$key] * $_SESSION['itemprice'][$key]).'</td>'; The difference is this code would compute the sub-total then display it. Hope that helps.
  7. I could see this working fine. I do something very similar internally on some of my projects. However I would recommend your remote login script to pass some kind of shared security token to your app. It may be a token that changed on a fairly regular bases to detour someone else from authenticating themselves with a known user. Another food for thought would be to restrict by IP which clients can send remote login info. Anyone else have any thoughts to add?
  8. Take a look at PHP Simple HTML DOM Parser. http://simplehtmldom.sourceforge.net/
  9. If I'm understanding you correctly there are two tables in the database one 'library' and one 'files'. If the library table contains an id referencing a file in the file table you could try joining the two tables together in a query and use the first part of your script for everything you need. You wouldn't have to browse the directory using the second part of your script. Pseudo example: $sql = "SELECT * FROM library l JOIN files F ON L.FILE_ID = F.FILE_ID"; Just a thought.
  10. You could try grouping by property_id, beds, baths to get a unique set of matching properties/bed/bath list. I created a test environment with similar tables. Here's the query I used: SELECT * FROM `properties` p LEFT JOIN floorplans f ON p.property_id = f.property_id WHERE p.zip_code = '77075' AND f.beds = 3 and f.baths = 2 GROUP BY p.property_id, f.beds, f.baths Is this what you're looking for?
  11. In my experience I've had to use the alias on the wild card too. Try: SELECT products.product_id_number AS product_id, products.* FROM products
  12. The simple answer to your problem is not to add that field in your update query. All the server knows to do with that statement is update the field to whatever you give it. If you're creating this query in a script (PHP for example), you could control what fields get updated based on if variable is NULL or Empty. Example: If you wanted to leave the data unchanged for the field metaDesc. You would change or have your script change the query to the following. UPDATE cms SET metaName = '$metaKey' WHERE rowID = 1 I would look into writing the script to check to see if the variables are empty before including them in the query. You could build it to where it dynamically builds the query before executing it.
  13. Take a look at the MySQL's min() function. It will return what ever is the lowest value in the field you tell it to use. http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_min
  14. Sorry, I must have not been paying attention this morning. You could create two select queries and use a UNION, then group by the ID field. This would give you a unique list of all ids from both tables match or non-matching. Example: SELECT * FROM ( (SELECT ID FROM TABLE_A) AS A UNION (SELECT ID FROM TABLE_B) AS B ) GROUP BY ID May not be the best query. But it would work.
×
×
  • 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.