Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/05/2021 in all areas

  1. A good thing to have is a good IDE that will point out the common syntax errors and find good resources/tutorials online to help with the logic flow. As for Database Tables I like using PDO and I still go to the following online resource when I get stump or have a brain fart. https://phpdelusions.net/pdo 🤣 I go here and other forums to see if someone before me has had the same problem and if not I will attempt to ask a question while showing my work. I learn over the years not to show too little or way too much code. I find commenting code help not only me but the people helping me trying to solve my problem(s).
    1 point
  2. Try this instead $select_tag = "<select onchange='reload(this.form)'>"; $select_tag .= "<option>test one</option>"; foreach ($data as $output) { $select_tag .= "<option>" . $output['header'] . "</option>"; } $select_tag .= "</select>"; Now - in your html area simply place the $select_tag var where you want this html to show up.
    1 point
  3. You're not trying to use a return value from your query method in that code. Notice the line containing the call to query doesn't contain a $something = in front of it. You're DB::getInstance() method does return a value, which gets assigned to $user in that code. In the single-line version of the code, the value returned by DB::getInstance() is not captured, just used temporarily for the call to query. If you wanted a multi-line equivalent of your single line version it would be: $tmp = DB::GetInstance(); $user = $tmp->query('...'); if($user) { echo "success -> "; } else { echo "fail -> "; }
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.