Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. 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.
  2. Where is the syntax error?? (Hint: if you turn display_errors back on, you will get a line number from PHP)
  3. 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.
  4. 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.
  5. 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.
  6. $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.
  7. 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.
  8. 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?
  9. Can we see the code that follows those corrected assignments?
  10. 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.
  11. 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?
  12. 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?
  13. How do you know the first result is not in the first array element?
  14. When you get something written and want help with it, post it.
  15. You're right. I don't understand anything you just wrote.
  16. YOu have posted code that is unfamiliar to me. What is 'db::getinstance'? What is '$results=>results()'? And which line is giving the error?
  17. 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.
  18. 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.
  19. Have you read any PHP resources?
  20. 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.
  21. 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.
  22. 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.
  23. 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.
×
×
  • 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.