Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by HuggieBear

  1. I think I'd break it down even further. Take a look at the osCommerce structure attached. It's a bit daunting the first time you look at it, but you're interested in the following tables: product_options product_options_values product_options_values_to_product_options product_attributes They're just right of center above the brown languages table. If you want an example as to what data would go in each table I can probably provide it. Regards Rich [attachment deleted by admin]
  2. Is your server running in safe mode? It does impose some restrictions when using mkdir().
  3. This looks like homework, or an assignment. What do you think each one means? Check out the link that WolfRage posted and don't just re-post your question because the answer you got wasn't what you wanted! Also, check the manual for info on language variables
  4. Thanks for the pointer. You're right, it's mysql_options(). I don't think that PHP has an option to call this API function though.
  5. Why don't you format it like the forum here... [link=www.url1.co.za][/link] [link=www.url1.co.za]This is the link text[/link]
  6. You can use curl_setopt() with the values of CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE.
  7. I expect something like this is going to give you what you're after SELECT p.post_id, p.content, p.author, f.user_id FROM posts p LEFT JOIN flags f ON p.post_id = f.post_id
  8. Oh ok, I didn't realise that. Do you know where I can find it?
  9. Make sure that your button passes the unique identifier to the processing page. In your case it's the username. Then the processing page uses either $_POST['username'] or $_GET['username'] to retrieve the exact row for editing.
  10. This content shouldn't be in the <head> </head> tags... <a href="loggedin.php">Back to Main Page</a><br /> <a href="profile.php">View Profile</a><br /> <a href="logout.php">Logout</a><p> This is where you can edit your profile <?php echo $_SESSION['isloggedin']; ?>!
  11. Add a closing curly bracket before the footer. It's needed to close your while loop. </form> </div> </div> <?php } // <-- Added this ?> <?php include "includes/footer.php"; ?>
  12. I'm not interested in the UID so I'll changed it to a single insert and I'll see what happens.
  13. Do you mean the max_execution_time in PHP? If so then it's set to 180. Cheers Rich
  14. You're wrong, when each of those HTML form fields called form[] are passed into PHP, it will see them as items in an array. Create the following file form_test.php <?php echo '<pre>'; print_r($_GET['form']); echo '</pre>'; ?> Now call it with a string like this: form_test.php?form[]=string1&form[]=string2&form[]=string3 This is exactly what the string would like like if you were using the GET method in an HTML form. Something tells me you'll be surprised by the output. Regards Rich
  15. I'm not sure I understand what you mean. You know what it's returning because you've specified it in the SQL statement. Incidentally, it's preferable to use "SHOW COLUMNS" syntax rather than mysql_list_fields. Regards Rich
  16. I have about 150 rows that I'm inserting into my database. Is it better to loop through the data doing a mysql_query() for each insert, or loop through the data creating a sql statement with a single insert. See below for example: <?php // Multiple inserts in a loop foreach ($row as $k => $v){ $sql = "INSERT INTO table_name VALUES ($row[$k], $row[$k])"; mysql_query($sql, $db); } ?> or <?php // Single insert after creating a string in the loop foreach ($row as $k => $v){ $sql .= "($row[$k], $row[$k]),"; } // Remove final comma rtrim($sql, ","); $final_sql = "INSERT INTO table_name VALUES " . $sql; mysql_query($sql, $db); ?> Regards Rich
  17. It is in PHP. Regards Rich
  18. 1. I think it's an OK way of doing it, I don't create pages like this using includes for the content but I know lots of people do, so it's got to be fairly popular. 2. If you have mod_rewrite then you can use it to make SEO friendly URL's. 3. You haven't included any pagination code so it's difficult to say why the links for next and previous don't work, but my guess would be that you'll need to use $_SERVER['QUERY_STRING'] or $_SERVER['REQUEST_URI']. When you request index.php?page=home the value of $_SERVER['QUERY_STRING'] should be set to page=home. Pagination links should then look at little like this: $next = 'index.php?' . $SERVER_['QUERY_STRING'] . 'currentpage=' . $page; Click here to find out more about the $_SERVER global. Regards Rich
  19. What are the data types of the columns? You got ENUM going on there? Regards Rich
  20. It's best not to do this through phpMyAdmin as it doesn't support it properly. Do it through the command line. Regards Rich
  21. OK, lets start off by saying I'm going to call the classified ads 'articles' for the sake of differentiating them from 'ads' that are provided by advertisers (similar to google ads). If you want to 'crawl' the articles then I'd do it before inserting it into the classified table. Here's what I'd do... Create a keyword column in classified table to store crawled keywords [submission of article] When article is submitted, crawl for keywords Insert article and keywords into classified table [Retrieval of article] User searches for articles Recordset returned into php Query links table where category IN (comma seperated keywords list from all above articles) Loop through recordset to display ads Regards Rich
  22. Are you running this from the command line client? Not through phpMyAdmin or something like that? Rich
  23. Try this Replace your *+ 45 minutes* with + INTERVAL 45 MINUTE Regards Rich
  24. This means that you already have an 'AFTER UPDATE' trigger on the 'plots' table. You can only have one trigger of each event type. Regards Rich
  • 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.