Jump to content

niche

Members
  • Content Count

    3,393
  • Joined

  • Last visited

Community Reputation

129 Excellent

1 Follower

About niche

  • Rank
    Devoted Member
  • Birthday 01/01/1958

Profile Information

  • Location
    Lincoln, Nebraska, USA
  • Interests
    coding, inventing, selling, building large scale models, sci fi

Previous Fields

  • Languages
    php, mysql, html, css, javascript

Recent Profile Visitors

53,202 profile views
  1. niche

    From Mysql To Mysqli but gives error's

    JSG said it best. $con doesn't exist. Obviously, the site's not making the connection. For me, that was the whole point of learning how to code. How do I manage the use of frameworks and libraries, when I know I don't have the code skills that would've allowed me to do it myself. https://www.w3schools.com/php/php_mysql_connect.asp I'm not criticizing any one. Just talking for myself. IMHO, frameworks and libraries are the rewards for knowing how to code. EDIT: If needed, there are very good vids on youtube RE: PHP Objects
  2. niche

    From Mysql To Mysqli but gives error's

    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?
  3. niche

    PDO binding for a MYSQL LIKE

    Voila! Thanks for your help.
  4. niche

    PDO binding for a MYSQL LIKE

    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?
  5. niche

    PDO binding for a MYSQL LIKE

    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%' ));
  6. niche

    using dynamically named array inside foreach loop

    http://php.net/manual/en/language.variables.variable.php (3rd example).
  7. niche

    using dynamically named array inside foreach loop

    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"
  8. 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.
  9. niche

    Combining Select Queries

    My understanding is # is for comments
  10. niche

    Combining Select Queries

    https://www.w3schools.com/sql/sql_insert_into_select.asp
  11. niche

    Insert contact Page PHP file in html.

    where do define $from?
  12. niche

    Insert contact Page PHP file in html.

    What's in $_POST['Message']?
  13. niche

    Combining Select Queries

    Sounds like you want something like this: https://stackoverflow.com/questions/14907863/insert-data-from-one-table-to-another-in-mysql
  14. niche

    Insert contact Page PHP file in html.

    For starters, is the action really named index.php?
  15. niche

    Introduce Yourself

    Look forward to your questions!
×