Jump to content

ronc0011

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by ronc0011

  1. I know this is a super newbie question but I am totally new to PHP and I’m coming from a Microsoft world i.e. ASP.NET also some early ActionScript. So today I’m hoping to find a good working explanation of these two operators.
  2. Really? Well clearly something's causing the errors that I apparently haven't spotted yet. As I've already noted I got the string entered just as you've given and it worked fine typed directly into the interface, While the attempt immediately before that I had done exactly the same thing only I had clicked on the next column definition and it threw the error. I suppose I may have typed a period "." instead of a comma "," somewhere though I was being pretty careful about that. As I noted before I had also by this time started trying to enter the list in shorter segments i.e. just 3 or 4 names, etc. I suppose I could try recreating different incorrect scenarios attempting to recreate the problem.
  3. Actually I tried that while wasting time waiting on totally useless & pointless responces from others. As it turned out I think it may have been a quirk in the way Workbench operates. I discovered that while I was entering the detail of a column such as an ENUM column, when I clicked to the next column to begine the next column expecting that Workbench would commit the entries I had just made. Instead it threw errors. It seems you absolutely must click the "Apply" button else if you click the next line where you would begin defining a new column Workbench chokes and throws an error saying that the data type you have given is not valid or something to that effect. Taking care to use the "Apply" button while also manually typing in the string does work. Oddly at one point I was typing in truncated versions of the string in question & still getting the error. Turns out it was the issue of moving to the next line in the Workbench interface that was causing the issue. This doesn't cause a problem if the data types are "VARCHAR(45)" or "INT" the default data type or INT. So actually I was just creating the columns like I had been doing all along but the ENUM() data type kept throwing this error for reasons I couldn't figure out. In the case of an ENUM() data type you must use the "Apply" button
  4. So you just aren't or can't answer the question why MySQL is giving me issues over my ENUM()data type. Lucky for me I managed to sort it out without any help from you. Or should I just accept the idea that for some weird inexplicable reason MySQL doesn't like my list of manufactures as an ENUM() data type.
  5. I really didn’t think the question was that difficult. When it’s all boiled down to its barest simplest element. The question is; “WHY is MySQL giving me errors on my ENUM() data type?”. Anyway, never mind that, I sorted it out, sort of. I really don’t have any questions about how I’m designing my tables. In fact, designing the table is what I’m doing. For you guys edification this is not a database for something like a dealership. It is intended to be a backend for a company’s fleet maintenance schedule. So of course the company might have Company cars, local & over the road delivery trucks, vans, etc. The Web based app needs to have an admin page where a manager can enter and update new records. At the same time the drivers, mechanics or other users need to be able to update individual maintenance records In any event the design part is what I’m actually doing now. In association with “make” & “model” there needs to be records for things like “oil change”, “Tire change”, “belts & hoses”, etc. then other things such as mileage per day – week, so on & so on… In this scenario “make” ideally needs to be a multiple choice drop down selection. So let’s move on from the separate table approaches. Granted as the design process moves forward no doubt many changes will need to be made as the need makes itself apparent.
  6. So that doesn't really answer the question does it? Design is still in it's early stages, nothings settled or even determined. At this point the only real question I have is what's up with the ENUM() data type. And BTW I just tried it with typing in the string by hand one at a time i.e building the string manually. It didn't like that either. I'm pretty sure I've done this before in PHPMyAdmin with less aggravation. In fact I created a column just before this one that worked just fine. However, it does occur to me that the previous column had no upper case characters in it but the "Model" column has and needs to use upper case characters in it i.e. GMC etc...
  7. I'm working with MySQL Workbench building a Database that will have multiple tables. and one of the columns needs to be an ENUM data type. And I don't seem to be able to provide the correct syntax or something. In the create table window I have selected the desired column "make' it's a cars DB and I want an ENUM type to list the various manufacturers i.e.; 'Ford’,‘GMC’,‘Chevorlet’,‘Chrysler’,‘Dodge’,‘Buick’,‘Toyota’,‘Volvo’,‘international’,‘Kenworth’,‘Peterbilt’,‘Mack’,‘Freightliner’,‘Isuzu’ For reasons I haven't been able to spot it keeps throwing this error. "The given Data Type contains errors" To avoid Type-O's I have been copy & pasting this string from a notepad file so I can double check my typing and syntax etc. Is it the copy & paste that's causing the issue?
  8. Actually the second one is just a leftover from me cutting and pasting. I copied the second one and pasted it into the space above the INSERT line and then I just forgot to comment out the first occurrence of it, the one at the bottom. It's just me shuffling stuff around and attempting to post the examples to this forum. Anyway your advice worked and pointed the way for me so now I can tweak to my hearts content and find and prove all my mistakes while knowing what's correct and works.
  9. OK just for clarity sake here is what just worked... <?php include 'conn.php'; if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':fname', $fname); $stmt->bindValue(':lname', $lname); $stmt->bindValue(':email', $email); $stmt->execute(); // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':fname', '$_POST["fname"]'); $stmt->bindValue(':lname', '$_POST["lname"]'); $stmt->bindValue(':email', '$_POST["email"]'); $stmt->execute(); /* if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } */ ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form method="post" action="insert.php" > First Name: <input type="text" id="fname" name="fname" /><br /> Last Name: <input type="text" id="lname" name="lname" /><br /> email: <input type="text" id="email" name="email" /><br /> <input type="submit" value="submit" /> </form> </body> </html> I moved the INSERT statement inside the "if' statement and using the PHP variables " $fname, $lname, $email " this time without any quotes. I'm thinking that those two things together were what was giving me grief. I know you gave me references in the PHP documentation, I'll have to re-read back through this thread and track it down. Honestly the PHP documentation I find to be difficult to follow, thus my preference for the YouTube tutorials. I do in fact go to the PHP documentation periodically put it usually isn't my first choice 'Go To" resource. Well, I really do gotta go to work now. And thank you again for your help & patience.
  10. HA!!!! that did it I'm afraid the whole naming thing is really twisting me in knots. It's something I'm really going to have to work on a lot. I really gotta thank you a lot for your help & patience. I know I'm gonna be working a lot with this, ie. update, delete, select, etc. hopefully I'm on the right track now.
  11. One last attempt before I go to work. I did some more tinkering with the code and here's what I have now... <?php include 'conn.php'; if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':fname', '$_POST["fname"]'); $stmt->bindValue(':lname', '$_POST["lname"]'); $stmt->bindValue(':email', '$_POST["email"]'); $stmt->execute(); /* if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } */ ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form method="post" action="insert.php" > First Name: <input type="text" id="fname" name="fname" /><br /> Last Name: <input type="text" id="lname" name="lname" /><br /> email: <input type="text" id="email" name="email" /><br /> <input type="submit" value="submit" /> </form> </body> </html> OK so this isn't throwing errors. But what it is sending to the database is "$_POST["fname"], $_POST["lname"], $_POST["email"] " It seems no matter what I try to use in the bindValues lines i.e. $fname etc. or $POST_[fname]... no matter what it doesn't like it, period. Also the echo statement isn't doing anything.
  12. OK I'm back to working on this seemingly impossible tast. Here's what i'm trying to do. I have a prepared INSERT statement and I want to use values that I get from an html form. I can get the INSERT statement to work if it is the only thing on the page with no output back to the page but as soon as I start trying to incorporate the form retrieval elements or the output elements it all crashes... This works but it outputs nothing to the screen so I have to open PHPMyAdmin to check the results. but it is there ... <?php include 'conn.php'; $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':fname', 'alice'); $stmt->bindValue(':lname', 'may'); $stmt->bindValue(':email', 'a@may.me'); $stmt->execute(); ?> So OK when I try to feed this statement data from my form and then output it to the screen Nothing I try works which should be evident from the myriad post I've already made here on this subject. here's my latest attempt. <?php include 'conn.php'; /* if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; } */ $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':fname', '$_POST['fname']'); $stmt->bindValue(':lname', '$_POST['lname']'); $stmt->bindValue(':email', '$_POST['email']'); $stmt->execute(); if(isset($_POST ['fname'])) { $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form method="post" action="insert.php" > First Name: <input type="text" id="fname" name="fname" /><br /> Last Name: <input type="text" id="lname" name="lname" /><br /> email: <input type="text" id="email" name="email" /><br /> <input type="submit" value="submit" /> </form> </body> </html> NOTE: I have tried several variations on the values in the Bindvalues lines everything just keeps throwing errors. OK so I gotta go to work. Probably wont get back to this until tomorrow morning. Thank you to everyone who has been trying to help me with this.
  13. You were right I didn't see it at first. Like I said fatigue starts getting me. What I'm really trying to do is bind the values from my htmlform to the fname, lname, email placeholders, but when I started getting all these errors it derailed m. Got me totally off track of what I was trying to get to work.
  14. It's really starting to look like I'm in for a repeat of the same scenario I experienced sooo many times before. Tomorrow I'll have to go to work and I'll be exhausted when I get home and will never even think of this again until just maybe if nothing else cones up just maybe next weekend. Would'nt hold my breath. Just as likely to be another 6 months before I get to revisit this again. I do appreaciate you guys trying to help though. I think if I actually had a working example of code that does this complete from html form to the php that processes it and outputs the results to the page I could probably track down where I'm going astray
  15. benanamen, Well that is the point. I get lost in all this rewriting the code over and over between all the errors and everything else. Today is another example. Just like previous days fatigue is beginning to take hold and the never ending errors are really wearing me down. I’ve been at this going on 4 days and it keeps crashing around the same place I just rebuilt the example from a tutorial I was following and it works. It doesn’t output anything to the page but the new records do show up in the database. What this example doesn’t show is how to retrieve the values from an html form So what I’ve been attempting to do is combine the examples of processing form data with a prepared INSERT statement. I can get the prepared INSERT statement to work just fine… Current example. I just rebuilt this from the example I’m working from and it WORKS [code} <?php include 'conn.php'; echo "Hello World!"; $stmt = $db->prepare("INSERT INTO guest(fname, lname, email) VALUES (:fname, :lname, :email)"); $stmt->bindValue(':fname', 'manny'); $stmt->bindValue(':lname', 'danny'); $stmt->bindValue(':email', 'md@dann.com'); $stmt->execute(); ?> [/code] However the previous page same code persist in throwing this error. "Invalid parameter number: parameter was not defined in C:\Apache\htdocs\insert3\insert.php on line 9" BTW Line 9 is the execute line. Here is the previous page I was working with and when I couldn’t get it to stop throwing errors I cut it back to just the code from the tutorial example and it continues to throw the errors. It’s not a cash issue, I renamed it and it still errors So why is one page throwing errors and the other one isn’t? <?php include 'conn.php'; $stmt = $db->prepare("INSERT INTO guest(fname, lname, email)VALUES(:fname, :lname, :email)"); $stmt->bindValue(':firstname', 'johnny'); $stmt->bindValue(':lastname', 'bob'); $stmt->bindValue(':email', 'jb@coit.me'); $stmt->execute(); ?>
  16. OK, so I added the execute line & now it’s throwing an error … “Invalid parameter number: parameter was not defined” This is supposed to be on line 15, the “execute” line The adjusted code. Process.php <?php include 'conn.php'; if(isset($_POST ['firstname'])) { $fname = $_POST['firstname']; $lname = $_POST['lastname']; $email = $_POST['email']; $stmt = $db->prepare("INSERT INTO guest (fname, lname, email) VALUES (:$fname, :$lname, :$email)"); $stmt->bindValue(':fname', '$fname'); $stmt->bindValue(':lname', '$lname'); $stmt->bindValue(':email', '$email'); $stmt->execute(); } $stmt = $db ->query('SELECT * FROM guest'); $results = $stmt->fetchAll (); foreach ($results as $row) { $firstname = htmlentities($row ['fname']); $lastname = htmlentities($row ['lname']); $email = htmlentities($row ['email']); echo $firstname . " " . $lastname . " " . $email . "<br />"; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div style =" border:1px solid black; margin-bottom: 30px; padding:20px 20px 10px 30px;"> <a href='index.php'>HOME</a> <br /> <a href='myform.html'>My Form</a> <br /> <a href='process.php'>PROCESS</a> <br /> <a href='conn.php'>CONN.PHP</a> <br /> </div> </body> </html> <?php //echo "Hello," . $firstname . " " . $lastname . " your email is " . $email; // echo "<br />" . "<br />" . "<br />"; // echo "<a href='index.php'>HOME</a>" . "<br />"; // echo "<a href='myform.html'>My Form</a>" . "<br />"; // echo "<a href='process.php'>PROCESS</a>" . "<br />"; // echo "<a href='conn.php'>CONN.PHP</a>" . "<br />"; // echo "<br />" . "<br />" . "<br />"; ?> So here’s something weird; the first time I ran this it output to the page … $fname $lname $email It added it to the list of other entries in the table “guest”. I’ve tried two different values in the VALUES argument. When I was first typing this in, the IDE kept wanting to auto complete the values as VALUES ($fname, $lname, $email). That didn’t seem right to me so I changed em back to VALUES (fname, lname, email) which is how the example I’m following has them. I’m thinking that when I tried it with the execute statement I was usining VALUES ($fname, $lname, $email). Thus the $fname $lname $email. But honestly I couldn’t say for sure. It starts getting almost impossible to keep track of these variables / place holders etc. In any event the firsttime I ran it it produced something even if it was something wrong. I then switched the VALUES and after that everything throws errors i.e. “Invalid parameter number: parameter was not defined' in C:\Apache\htdocs\forms\process.php on line 15” In any event they are both throwing the same error. I should probably clarify some things. The database “forms” has 1 table named “guest” with 4 columns “id”, fname, lname, email. The form has three input tags named “firstname”, “lastname”, & “email”. The php is defining 3 variables $fname, $lname, and $email. So now I’m back to throwing errors in the INSERT block or is it the “prepare” clause? Now this time there is no age field so no “int” issue.
  17. Just an update. this project was becoming such a cluttered mess I scrapped it. and BTW the last attempt after removing the quotes was still producing s string of errors. So anyway, like I said I abandoned this attempt and started a new run at it new project htdocs/forms/myform.html etc. The new thread is starting of better somewhat. the new thread is at... http://forums.phpfreaks.com/topic/298980-sql-insert-not-working/
  18. OK obviously I’m missing something. The good news is I’m not getting any errors Woo-Hoo!!! For background this is really just a continuation from an earlier issue / question... http://forums.phpfreaks.com/topic/298933-problem-with-prepare-statement/ I can’t figure out where it’s failing or the cause of it. Maybe someone here can spot it. Here’s what I’ve got so far… MyForm.html… <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form method="post" action="process.php" > First Name: <input type="text" id="firstname" name="firstname" /><br /> Last Name: <input type="text" id="lastname" name="lastname" /><br /> email: <input type="text" id="email" name="email" /><br /> <input type="submit" value="submit" /> </form> <br /> <br /> <br /> <br /> <br /> <br /> <div style =" border:1px solid black; margin-bottom: 30px; padding:20px 20px 10px 30px;background-color:#d6f3ff;"> <a href='index.php'>HOME</a> <br /> <a href='myform.html'>My Form</a> <br /> <a href='process.php'>PROCESS</a> <br /> <a href='conn.php'>CONN.PHP</a> <br /> </div> </body> </html> BTW I have put nav links in all these pages just to simplify my life a little. & next is the process.php file which is where the form sends the form data NOTE the html block is just to format and display the nav links…. <?php include 'conn.php'; if(isset($_POST ['firstname'])) { $fname = $_POST['firstname']; $lname = $_POST['lastname']; $email = $_POST['email']; $stmt = $db->prepare("INSERT INTO guest (fname, lname, email) VALUES (:fname, :lname, :email)"); $stmt->bindValue(':fname', '$fname'); $stmt->bindValue(':lname', '$lname'); $stmt->bindValue(':email', '$email'); } $stmt = $db ->query('SELECT * FROM guest'); $results = $stmt->fetchAll (); foreach ($results as $row) { $firstname = htmlentities($row ['fname']); $lastname = htmlentities($row ['lname']); $email = htmlentities($row ['email']); echo $firstname . " " . $lastname . " " . $email . "<br />"; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <div style =" border:1px solid black; margin-bottom: 30px; padding:20px 20px 10px 30px;"> <a href='index.php'>HOME</a> <br /> <a href='myform.html'>My Form</a> <br /> <a href='process.php'>PROCESS</a> <br /> <a href='conn.php'>CONN.PHP</a> <br /> </div> </body> </html> <?php // Leftover debris from earlier efforts / attempts. //echo "Hello," . $firstname . " " . $lastname . " your email is " . $email; // echo "<br />" . "<br />" . "<br />"; ?> Oh & BTW the conn.php file looks like this… <?php try { $db = new PDO('mysql:host=127.0.0.1;dbname=forms', 'root', 'r00t'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo $e->getMessage(); echo '<br>'; echo 'You may have a problem'; } echo "<a href='index.php'>HOME</a>" . "<br />"; echo "<a href='myform.html'>My Form</a>" . "<br />"; echo "<a href='process.php'>PROCESS</a>" . "<br />"; echo "<a href='conn.php'>CONN.PHP</a>" . "<br />"; ?> Another NOTE: I put nav links on all the pages just for the sake of making life a little easier as I jink around through these files trying to sort this out. The pages load and appear to work OK except the INSERT statement doesn’t seem to be doing anything at all. But nothing is throwing any errors. I’m getting output from the “fetchAll” / “foreach block. But the records it is returning are existing records that I entered when I built the database Just to check this out I setup this alternate configuration. I changed the “Action in the myform.html file to point to a file called showMe.php on which I just copied the first part of process.php. i.e…. The showMe.php file... <?php include 'conn.php'; if(isset($_POST ['firstname'])) { $fname = $_POST['firstname']; $lname = $_POST['lastname']; $email = $_POST['email']; // I add this just to check that the asignment lines are working. echo "Hello" . $fname . " " . $lname . " " . "your email address is" . $email; } ?> And guess what it all works except for the INSERT clause / statement. So what am I missing here?
  19. First & foremost I want to thank everyone for your replies but unfortunately that boat has sailed. I’ve abandoned that line of attack and moved on. I’m thinking maybe my first step should be; How to load form data into php variables here’s my current attempt (failed)… First part of my page… <?php include 'conn.php'; ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <form method="post" action="insert2.php"> First Name;<input type="text" id="firstname" name="firstname" /> <br /> Last Name<input type="text" id="lastname" name="lastname" /><br /> Post Code<input type="text" id="postcode" name="postcode" /><br /> <input type="submit" value="Add" /><br /> </form> <br /> <br /> </body> </html> Last part of page in PHP tags… <?php $firstname = $_POST ['firstname']; $lastname = $_POST ['lastname']; $postcode = $_POST ['postcode']; $stmt = $db ->prepare ("INSERT INTO names (firstname, lastname, postcode) VALUES (:firstname, :lastname, :postcode) "); $stmt ->bindValue(':firstname', '$firstname'); $stmt ->bindValue(':lastname', '$lastname'); $stmt ->bindValue(':postcode', '$postcode'); $stmt ->execute (); $stmt = $db->query("SELECT * FROM NAMES"); $results = $stmt ->fetchAll(PDO::FETCH_ASSOC); foreach ($results as $row){ $firstname = htmlentities($row['firstname']); $lastname = htmlentities($row['lastname']); $postcode = htmlentities($row['postcode']); echo $firstname . ' ' . $lastname . ' ' . $postcode . '<br>'; } ?> & BTW the conn.php page looks like this… <?php try { $db = new PDO('mysql:host=127.0.0.1;dbname=testdb', 'root', 'r00t'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo $e->getMessage(); echo '<br>'; echo 'You may have a problem'; } ?> No doubt there are any number of problems with this page but apparently the first is with the assignment of form data to PHP variables because it is throwing this error “Undefined index: firstname” for all 3 variables i.e. $firstname = $_POST ['firstname']; $lastname = $_POST ['lastname']; $postcode = $_POST ['postcode']; Lines 33, 34, 35. Also, new DB this one has 4 fields “id”, “firstname”, “lastname”, “postcode” And BTW the fetchAll and foreach loop appear to work just fine because the page does output the 15 or so recordsets after it displays the errors.
  20. I’m trying to post data to a MySQL DB table. In fact I’m working on learning how to interact with a DB from a web form. I had it almost working a couple of times but when I start trying to tweak it, it all goes awry. But the consistent issue that keeps popping up is an issue with “ Incorrect integer value: ':age' for column 'age' at row 1 “ This table "people" in the DB "peoples" has 3 columns; “id”, “name”, “age”. I was able to get it to work as long as I stuck with a numbered array. But when I try to use an associative array I start getting the error. The only thing I can think of is the id field in the DB. That maybe that’s throwing off my row count. Though obviously I don’t want to display the id field data in my webpage. So here’s the basic code I’m trying to make work. <?php include 'connForm.php'; ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>PDO with Forms</title> </head> <body> <form method="post" action="connform.php"> Name: <input type="text" id="name" name="name" /> <br /> Age: <input type="text" id="age" name="age" /> <br /> <input type="submit" value="add" /> <br /> </form> <br /> <br /> </body> </html> <?php echo htmlentities($row['name']). " is " . htmlentities($row['age']). " years old " . "<br>"; ?> conform.php contains the following code… <?php try { $db = new PDO('mysql:host=127.0.0.1;dbname=peoples', 'root', 'r00t'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo $e->getMessage(); echo '<br>'; echo 'You may have a problem'; } $stmt = $db->query('SELECT * FROM people'); $result = $stmt->fetchAll (); foreach($result as $row) { $name = htmlentities($row ['name']); $age = htmlentities($row ['age']); } if(isset($_POST ['name']) ) { $name = $_POST ['name']; $age = $_POST ['age']; $stmt = $db ->prepare ("INSERT INTO people (name, age) VALUES (':name', ':age') "); $stmt ->bindValue(':name', $_POST ['name']); $stmt ->bindValue(':age', $_POST ['age']); $stmt ->execute (); } ?> One of the biggest problems with trying to learn anything from the internet isthat everybody has their own way of doing everything and each one wants to show off their precieved expertise. This means that trying to learn anything means trying to distill all these dispirit methods into the simplest cut & dried method I can manage. oddly of all the tutorials out there on YouTube dealing with PHP and PDO there are almost none dealing with PDO and web forms. I say "none" I mean, like 2 maybe 3 though I don't think I've found #3.
  21. Haa!! That worked !! Great! Who'd a thunk it Thanks I appreciate the input.
  22. Hmm I'll give it a try. We'll see.
  23. Oh yeah I forgot to mention I'm creating this in my Visual Studio IDE.
  24. I've already read that one ond all the others that show up on the first page of a Google search. they all give the results I described here. So apparently there is no way to actually set the thickness of the line. I even tried just using a underscores in a h1 tag and then styling with margin font-weight, font-size etc. but couldn't actually get reliable cross browser results i.e. centering etc. BTW this is for an Ebay listing which allows HTML in its editing page
  25. I've been trying for 2 hours to set the thickness on an hr tag and no matter what I try the best I can get is something that looks like a box. If I give it something like size: 25em; or height;20px; "whichever you like" the best I can get is something that looks like a box, a vertical line on the right side that is apparently 25 em high with a horizontal line that appears to be maybe 2px high. Is there a way to actually change the thickness of the line/
×
×
  • 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.