Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You're right. I don't understand anything you just wrote.
  2. YOu have posted code that is unfamiliar to me. What is 'db::getinstance'? What is '$results=>results()'? And which line is giving the error?
  3. In your php code that outputs the radios, use a loop to output each one using a var to set the value clause of the button and to set an array value like this: $no_btns = 10; // how many buttons to output for ($I=1;$I<=$no_btns; $I++) { $val = 'radio'.$i; $disab = ''; if ( isset($_SESSION[$val]) && $_SESSION[$val) == "X") $disab = 'disabled'; // echo "<li><input type='radio' name='placeInLine' id='choice$i $disab value='$i' onclick="toggle('show')"/>11:15-11:30</li>"; } When your script retrieves the input from the client and determines the radio button that was selected, you set that session value as in if ($_POST['placeInLine'] <> ''){ $val = 'radio' . $_POST['placeInLine']; $_SESSION[$val] = "X";} Of course you need to validate the incoming post values before doing this.
  4. Silly ? perhaps but are Num & Paid alphanum fields in the table? And just for grins, test the value of $stmt after the execute is done.
  5. Have you read any PHP resources?
  6. It would behoove you to do some research on sql syntax and learn how to join those tables in a query with just one where clause.
  7. As Mac_Gyver says - if you want people to even try and help you, help them by limiting your post to the parts that directly related to the problem. One question - do you Really need to do 3 separate queries of your 3 tables to get the info that you want? The beauty of a properly constructed db and sql is the power to tie data together in a result as needed.
  8. uhhh - need a bit more direction here. When you say 'timeline' I envision a line on the page. Or a list of times. What is the granularity of this timeline? And how many radio buttons do you have to associate with this timeline? Removing a button s/b no problem. Simply create a session array var and make entries for each button value you output. When one is picked, tag that array element as used and then regenerate your button elements, disabling any that has already been picked, as indicated by the session array.
  9. I'm so glad that I was not alone in my recognition of the OP's possible motives with his post. Thankfully many of you have a conscience that goes beyond your ability to code stuff.
  10. So I'm not alone in my paranoia. To the OP - really man? This is what you want to accomplish with your skills? You want to incorporate yourself into the mass of idiots who think that the 'net is theirs to tamper with and use for financial and other profit? Add to the sea of spam generated by people with brains but no common sense?
  11. Is this forum actually helping someone to prepare and send "spoofed emails"?
  12. Your plan is correct. While JS will keep the user from having to deal with a delayed error message from PHP, you should always re-edit your input at the server to prevent hacking. That said, I'm confused by your last statements. Do you not know any php? Or just not ready to put in the work to figure out this problem? Basically I would grab each of the 4 inputs (answers) and then count how many are not empty. If there were too many answers, then I would send back the page (with the previous answers as the values of the html) and an error message advising them to make a change. Don't forget the php manual - an absolutely invaluable resource for php developers of all levels.
  13. add some echos to help identify where you get redirected back to login page. Echo your query too so you can verify it is what you think it is. Silly question, but does your index.html use a POST action to get to this script, or a GET? Also - you really need to do some filtering on your post vars to ensure that you are getting proper input and not endangering your app/db.
  14. Use your date value as the key value of your array and assign the project id as the value of each item in the array $dates_array['17-02-14'] = 15 $dates_array['18-02-14'] = 15 Pass the id to the function and change the function from: $datesArray[] = date($format, strtotime("{$startDate} + {$day} days")); to: $k = date($format, strtotime("{$startDate} + {$day} days")); $dates_array[$k] = $proj_id; where $proj_id is passed in as a param
  15. The join was probably doing everything correctly. Your output scheme is probably to blame. You need to add some code to recognize when a new record is the same (key?) as the last one, and in that case only output the image from that record. When the new record has a new key (diff from the last key), only then do you display all the data from the new record.
  16. can you post the code neatly in the proper tags? Many of us are hesitant to click on links to other (possibly 'bad') sites. That's why there are code tags implemented here.
  17. #1 - pagination on a mobile site is no different than a non-mobile one. #2 - try googling it and getting some code together and then if you have a problem, show it to the forum.
  18. Why don't you clean up that code, read the forum instructions and post your code properly afterwards so that we can read what you want us to amend for you?
  19. Just because you are now using PDO doesn't mean the basic principles don't still apply. $qstmt = $conn->prepare('SELECT * FROM customers'); $qstmt->execute(); while ($row = $qstmt->fetch(PDO::FETCH_ASSOC)) { $email = $row['email']; $testname = $row['name']; $testlastname = $row['lastname']; echo "$testname has a last name of $testlastname and an email of $email<br>"; } Note that you don't need to use prepare here since you don't have any arguments to your query.
  20. Instead of trying to write such a complex class, why not just use prepared statements? Trying to build a query statement for any and all circumstances would be an impossible task. Besides, the time it takes you write individual queries would never add up to the time it is going to take you to perfect such a thing (if even possible).
  21. I'm going to step in here to give you a couple of quick hints in case Jacques1 is offline. In the following lines: $num_items = mysql_result($result, 0, 'num_items'); and $num_comments = mysql_result($comment_result, 0, 'num_comments'); The variable named as the first argument of the MySQL_result call is the variable that was assigned the results of a query. You need to review the code preceding the error lines to check what variable name received the results for that specific query Look for a line such as : $result_var_name = mysqli_query(......); and be sure to match that variable name with the one in the fetch statement to correct those error messages, as below: list($num_comments) = $result_var_name->fetch_row();
×
×
  • 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.