Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You need to read up on doing JOIN queries so you can join the students to a group and not simply collect all the records from both tables that match your $tc value. btw - When you read up on JOINs you should read up on table aliases and try using them for your tablenames - makes it a lot easier to type your query and to read it later.
  2. Ps - looking at this code I get the impression that you don't know any php. Your coding skills and syntax errors are incredibly elementary. 1 - you are running the query twice - why? 2 - you are comparing a result row against the value of the radio button. Do you have any idea how impossibly wrong that is? 3 - you make reference to something called "$table(choice)" in your query statement. What is that supposed to be? 4 - you run the first insert query with nothing to capture the results. 5 - you create a query statement after #4 but you never run it Lastly you begin by running a query and capturing the results but you never use it. Plus I don't know what its relevance to the rest of the code is.
  3. Where is the syntax error?? (Hint: if you turn display_errors back on, you will get a line number from PHP)
  4. Apparently you know absolutely no php - and what is worse you don't even have the ambition to read up on it to figure things out. Sorry - but I feel no need to help out those who won't help themselves. good by and good luck.
  5. Save them as session vars. Or since you put them out to the form for the user to read, you can grab them from the form again when the user submits it, if you first make sure that the form is valid.
  6. Ok - so you echo out one form with the first row of data and you save the values in local vars. Now what do you do? YOu do realize that those vars will be gone once you exit this script to show the user the form? Oh - and BTW - this form has another of those stupid fragments of a line in it, so I am doubtful that you have ever run this code.
  7. $CustomerID = $_GET['CustomerID']; $FirstName = $_GET['FirstName']; $SecondName = $_GET['SecondName']; $PhoneNumber = $_GET['PhoneNumber']; echo "<form id=alleditcustomerform action='add-viewing' autocomplete='on' method='post' >"; echo "You have selected the following details.<br>"; echo "<br>"; echo "<label for='CustomerID'>Customer ID*:</label><br>"; echo "<input id='CustomerID' type='text' maxlength='20' name='CustomerID' value='$rowcustomer[CustomerID]' readonly /><br>"; echo "<label for='FirstName'>First Name*:</label><br>"; echo "<input id='FirstName' type='text' maxlength='20' name='FirstName' value='$rowcustomer[FirstName]' pattern='^[a-zA-Z]{2,20}$' required readonly/><br>"; echo "<label for='SecondName'>Second Name*:</label><br>"; echo "<input id='SecondName' type='text' maxlength='20' name='SecondName' value='$rowcustomer[SecondName]' pattern='^[a-zA-Z]{2,20}$' required readonly/><br>"; echo "<label for='PhoneNumber'>Phone Number*:</label><br>"; echo "<input id='PhoneNumber' type='tel' maxlength='11' name='PhoneNumber' value='$rowcustomer[PhoneNumber]' pattern='^\s*\(?(020[7,8]{1}\)?[ ]?[1-9]{1}[0-9{2}[ ]?[0-9]{4})|(0[1-8]{1}[0-9]{3}\)?[ ]?[1-9]{1}[0-9]{2}[ ]?[0-9]{3})\s*$' required readonly/><br>"; echo "<br>"; echo "<input id='addcustomertoviewing' type='submit' name='addcustomertoviewing' value='Add Customer' /><br>"; $CustomerID = $rowcustomer['CustomerID']; $FirstName = $rowcustomer['FirstName']; $SecondName = $rowcustomer['SecondName']; $PhoneNumber = $rowcustomer['PhoneNumber']; echo "</form>"; } Ok - I pulled some of your code out to make this point. At the top of this code you use the GET array to set some variables but then you use the query results to display the in the form. Then you set those local vars with the query results but you aren't displaying them anywhere.
  8. But that is not what we are seeing. How about showing us ONE simple set of code that all goes together where we can see what you are saying is happening? AND you still haven't answered the question concerning why you are using the GET array.
  9. While this code doesn't appear to be what I asked for, making it hard to piece together what is going on, my guess is that you do a query to populate $rowcustomer but then you set those vars using the GET array which may or may not have data and then you output those vars which may not have anything in them. Why are you using the GET array?
  10. Can we see the code that follows those corrected assignments?
  11. Your assignment of those variables seems flawed to me. $ProductID ='$rowproperty[ProductID]' ; is not going to assign the value of the row var, but rather the string: '$rowproperty[ProductID]' which is itself a flawed array reference. The proper form is $ProductID = $row[roperty['ProductID']; I noticed that your code begins by retrieving an awful lot of GET vars, but then your form clearly uses the POST method. Could this be part of your problem? Plus - using a GET for all that data is kind of risky.
  12. Please post your code properly. Read the rules. Now - what is the nature of your problem? If you wrote all the above code you know how to do everything you need to do, so what are you really asking us?
  13. Way too much code to go thru. Besides - you have some very strange php lines in this. What does this line do: $error And what do these lines do: mysql_real_escape_string($PostCode); mysql_real_escape_string($newrecord); That is certainly the syntax for that function. How about posting the part that is giving you the problem? Do you think a lot of people are going to wade thru your complete set of code to help you find one little problem?
  14. How do you know the first result is not in the first array element?
  15. When you get something written and want help with it, post it.
  16. Where is your php code? HTML does nothing for me.
  17. You're right. I don't understand anything you just wrote.
  18. Why do you need to insert into two tables?
  19. YOu have posted code that is unfamiliar to me. What is 'db::getinstance'? What is '$results=>results()'? And which line is giving the error?
  20. 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.
  21. 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.
  22. Have you read any PHP resources?
  23. 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.
  24. 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.
  25. 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.
×
×
  • 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.