Jump to content

vandero

New Members
  • Posts

    6
  • Joined

  • Last visited

vandero's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. GOT IT! I replaced the $_POST part with the assigned variable $ud_ part and it worked. But in the PHP manual it shows syntax examples of using $_POST in the line itself. So why does it work when I assign it to a variable but not when I put it directly in the statement. so $stmt->bindParam(':paid', $_POST['fPaid'], ..... became $stmt->bindParam(':paid', $ud_PAID, .... And it works. Thanks
  2. thanks for replying ginerjm. My Numb field is integer. My Paid field is varchar. I tried to echo the array $stmt which got my the string conversion error of course. I tried several other ways that I could think, using[$stmnt] and using the double then single quote with the period but kept getting an error. I think it should return a true or false if it worked or not, but cannot figure out to echo that return. I am thinking that I will try and put in the variables $ud_PAID and $ud_NUMB instead of the passed value using $_PAID. But that shouldn't matter as far I have read.
  3. [code] <html> <body> <?php include('connect.php'); $ud_NUMB=(int)$_POST["fNumb"]; $ud_PAID=$_POST["fPaid"]; echo $ud_NUMB; echo $ud_PAID; $sql = "UPDATE Teams SET Paid = :paid WHERE Numb = :numb"; $stmt = $db->prepare($sql); $stmt->bindParam(':paid', $_POST['fPaid'], PDO::PARAM_STR); $stmt->bindParam(':numb', $_POST['$fNumb'], PDO::PARAM_STR); $stmt->execute(); echo "\nPDO::errorCode(): "; print $stmt->errorCode(); ?> </br><p><a href='game.php'><H3>Back to main page</H3></a> </body> </html> [/code] My connect works fine, used in other scripts. $db is the connection. My echo of the two passed variables works fine. Example reply from echo is: 8Yes (didn't bother to put in spaces). The only reply on error is: PDO::errorCode(): 00000 I get the prompt to return to the website link at the end. No other error codes. But it does not update my record. It should change record with unique ID of 8 to show Yes in the Paid column. Can someone point me in the right direction here? Thanks
  4. Well you described my approach to this. I think in some cases this happens because of time constraints. Hey we need a website up and running in a few weeks, can you do that and work your two jobs, etc. So a good hearted person says I'll try and help you out. I need to learn about prepare, _GET and execute. Then this will be a piece of cake. Last step of the website too.
  5. I think I know what you mean by binding the variable. I had the values from the _GET part assigned to a variable earlier, but got rid of that thinking that was causing some of the problems. I will start with the first error, my frustration with that was the error messages would change but I couldn't be sure if I had revealed another issue that was hidden, or if I just had replaced one error with another error. This just can't be as complicated as I am making it out to be. Thanks.
  6. I need to get the value passed from another table. That is working as far as the URL: Teams.php?name=April <?php include('connect_php'); $result = $db->prepare("SELECT * FROM Teams ORDER BY Dateenrolled WHERE Teamname ="".$_GET["name"].""); $result->execute(); for($I=0;$row=$result->fetch(); $I++) { ?> <tr> <td width="7%"><?php echo $row['Paid'];?></td> <td width="10%"><?php echo $row'Teamname']; ?></td> </tr> <?php } ?> It shows my table but the error messages are 5 sentences long and include uncaught errors, lots of syntax errors and such. I can type them if needed. My PHP programming class was 12 years ago. Doesn't pull any data in to the table. Any help or suggestions would be great. Worked on this now for over a week off an on with nothing more than changing error messages.
×
×
  • 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.