Jump to content

niche

Members
  • Posts

    3,671
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by niche

  1. I'd start with resolving the first error. Looks like there's a problem with your login to your server EDIT: start with config.php does it produce errors by itself?
  2. Voila! Thanks for your help.
  3. Interesting. When I strip-out all the white space it works: $stmt2->execute(array(':itemandsize' => '%' . $var . '%')); I've heard of white space being a problem, but haven't knowingly experienced it. Any thoughts? Urban legend?
  4. This code works, but can someone tell me how I can use an array instead of bindParam in this situation. try { $sql = ' SELECT * FROM nconnectz WHERE itemandsize LIKE :itemandsize AND price > 0 ORDER BY price ASC '; $stmt2 = $db2->prepare($sql); } catch (PDOException $e) { echo $e->getMessage() . '<br>'; } $var = "%Flour%"; try { $stmt2->bindParam(':itemandsize',$var); $stmt2->execute(); } catch (PDOException $e) { echo $e->getMessage() . '<br>'; } Something like? $stmt2->execute(array( :itemandsize => '%Flour%' ));
  5. http://php.net/manual/en/language.variables.variable.php (3rd example).
  6. found the notation: ${$wkvar}[$i] = $val; If this has a name, pls let me know so I can get a ref? stumbled on to by finally googling: "dynamic naming arrays php"
  7. This works: $names = array( array("name"=>"tom","gender"=>"m"), array("name"=>"jane","gender"=>"f"), array("name"=>"steve","gender"=>"m"), array("name"=>"mary","gender"=>"f"), array("name"=>"renae","gender"=>"f") ); $num = 30; $wkvar = 'wk' . $num; foreach ($names AS $val) { $wk30[] = $val; //$$wkvar[] = $val; } var_dump($wk30); this doesn’t and gives me this error, “Fatal error: Cannot use [] for reading”, (goggle hasn’t helped me): $names = array( array("name"=>"tom","gender"=>"m"), array("name"=>"jane","gender"=>"f"), array("name"=>"steve","gender"=>"m"), array("name"=>"mary","gender"=>"f"), array("name"=>"renae","gender"=>"f") ); $num = 30; $wkvar = 'wk' . $num; foreach ($names AS $val) { //$wk30[] = $val; $$wkvar[] = $val; } var_dump($wk30); I need to use the 2nd (variable variable) approach. What am I doing wrong? I tried adding a dynamic index unsuccessfully.
  8. My understanding is # is for comments
  9. https://www.w3schools.com/sql/sql_insert_into_select.asp
  10. Sounds like you want something like this: https://stackoverflow.com/questions/14907863/insert-data-from-one-table-to-another-in-mysql
  11. For starters, is the action really named index.php?
  12. Look forward to your questions!
  13. this might help https://stackoverflow.com/questions/18342730/import-csv-file-with-php-using-pdo
  14. https://www.w3schools.com/sql/sql_alter.asp Then, use the CONCAT_WS keyword
  15. niche

    registry backup

    Experience tells me that If i'm thinking about restoring the registry, I'm probably going to get unexpected consequences. So, I'll probably just reinstall the system and get a good night's sleep. Having the backup is one thing. Using it is another.
  16. niche

    registry backup

    I agree that it's a bad idea. EDIT: I would opt for a fresh install.
  17. https://www.w3schools.com/cssref/pr_background-color.asp
  18. this might help https://css-tricks.com/css-variables-with-php/
  19. niche

    Dropping a table

    Do a 'SELECT * FROM closed' . If no error, it's still there unless corrupted. closed is not a reserved word, but close is.
  20. Not with CSS. I'd redesign the image with divs positioned around the image , with each div having a JS listener, in place of the finger points.
×
×
  • Create New...