Jump to content

sigmahokies

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by sigmahokies

  1. Hi everyone, Good news, I got myself figure it out. Missing in parameters was name of connection and dbname. Example - require('connection.php') OR $GaryDatabase = mysqli_connect('xxxxx",'xxxxx','xxxxx','xxxxx'); mysqli_select_db($GaryDatabase, "JoinDNO") <-- that is missing then... $insert = mysqli_query($GaryDatabase, "INSERT INTO...") That is how it works. i tested it many times...succeed insert data from text field. Now, I got other problem. I just made a script in PHP to display the record (data) on display, display is working, but seem problem is I notice reload and submit the blank textfield, I can see MySQL taking the blank data in database. How can I stop/prevent MySQL taking a blank data in database? Should I disable auto increment? or what? Please advise me... Thank you so much
  2. Thank you, everyone for advice and fixed my code, but it is still not work. I think it is company is what blocking me to do those database. I sent email technical support about my problem, they told me that they will not allow anyone using external remote control over database in phpmyadmin. Maybe that is why I said it is not working. I am using biz.ht for practice to my improve my skill in PHP, they offer me a small memory in website to use for free to use. Again, Thank you for trying to help me to understand with quotes, senstive uppercase and lowercase. I am still getting fatal error and parse error on my website in biz.ht.
  3. Hi Barand, I know you gave me a correct syntax, but it does not work. I checked connection.php, access is working. I followed your advice very exactly with quotes, still not work, still getting error. Even, I research many websites about how to two to insert the data in phpmyadmin, include stackoverflow website. I just don't want to depend on Dreamweaver to do for me. I rather to writing in code in PHP.
  4. Hi CyberRobot, I removed isset, but I did put two type of parameters () and {} already, but still not work...my source is in color, easy to see those words to program. If you are saying that I need to put single and double quote, that is what I did...look code below here: $insert = mysqli_query("INSERT INTO 1141650_sigma22.JoinDNO (ID,FirstName,LastName,City,State) VALUES (NULL,".$FirstName.",".$LastName.",".$City.",".$State.")"); if ($insert) { echo '<p>adding your name in list successfully</p>'; } else { echo '<p>Sorry, I could not add your name to list</p>'; } Check my website - http://sigmahokies.biz.ht/rvadno.php I got three error response.
  5. Hi cyberRobot, here my code: $insert = mysqli_query 'INSERT INTO 1141650_sigma22.JoinDNO (ID,FirstName,LastName,City,State) VALUES (NULL,'$FirstName','$LastName','$City','$State')"; if(isset($insert)) { echo '<p>adding your name in list successfully</p>'; } else { echo '<p>Sorry, I could not add your name to list</p>'; }
  6. Hi Barand, I tried that, it won't work. even I used single or double quote, still not work. Hi Gizmola, I used a quote that you show (just next left from #1 on keyboard), still not work. Do you like to see my code on this screen? of course, I won't copy all code, I will copy $insert then below...Please let me know, Thank you so much.
  7. Hello php freak people, I hope you can help me solve why #30 line can not solve the problem to query to allow fetch row in php...error log show "$FirsttName" is stopped by syntax error. Here my script: <?php require('connection.php'); ?> <html> <head> <link href="dnocolor.css" rel="stylesheet" type="text/css"> </head> <body> <p>Welcome to Gary Taylor's DNO website</p> <p>Please register below here if you want to go</p> <form action="" method="GET"> <fieldset> <table><tr><td colspan="4" align="center">Please type your name below here:</td></tr> <tr><td>First Name:</td><td><input type="text" name="data" value="<?php if(isset($_GET['Firstname'])) echo $_GET['FirstName']; ?>"></td><td>Last Name:</td><td><input type="text" name="data" value"<?php if(isset($_GET['Firstname'])) echo $_GET['LastName']; ?>"></td></tr> <tr><td>City:</td><td><input type="text" name="data" value="<?php if(isset($_GET['City'])) echo $_GET['City']; ?>"></td><td>State:</td><td><input type="text" name="data" value="<?php if(isset($_GET['State'])) echo $_GET['State']; ?>"></td></tr> <tr><td colspan="4" align="center"><input type="submit" id="submit" value="You are going"></td></tr> </table> </fieldset> </form> <hr> <?php if($_GET){ $fon = mysqli_connect('XXXXXXX','XXXXXXXXX','XXXXXXXX','XXXXXXXX');} if($fon === false){ die("Error, could not connect ".mysqli_connect_error()); } $FirstName = mysqli_real_escape_string($fon, $_GET['FirstName']); $lastName = mysqli_real_escape_string($fon, $_GET['LastName']); $City = mysqli_real_escape_string($fon, $_GET['City']); $state = mysqli_real_escape_string($fon, $_GET['State']); $insert = 'INSERT INTO 'XXXXXXXXXX' ('ID', 'FirstName', 'LastName', 'City', 'State') VALUES (NULL,'$FirstName','$LastName','$City','$State')'; if(mysqli_query($fon, $insert)) { echo '<p>adding your name in list successfully</p>'; } else { echo '<p>Sorry, I could not add your name to list</p>'; } $show = 'SELECT FirstName, LastName, City, State FROM XXXXXXXXX'; $result = mysql_query($show); while($row = mysql_fetch_row($result)) { echo '<table><tr><td>'.$row.'</td></tr><table>'; } ?> </body> </html>
  8. Hello everyone My name is Gary Taylor, I am learning PHP now, getting advance code in PHP now, but still struggle to complete. I hope you will happy to help me to solve my problem in PHP. It is nice to meet you all! Have a great day!
×
×
  • 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.