Jump to content

sigmahokies

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by sigmahokies

  1. ginerjm and psycho, ginerjm, All right, my apology if I don't make you understand. my purpose to ask anyone to see if anyone know how to do code in array into few columns, I can do one column. I am trying to have start with top, then down till 10th row, then go to other column with start with top, then go on till 10th row, continue. But I can increase number of row in column if necessary because I will have almost 200 names on database that I don't want to have their name in one column that can make long column on website, so I will like to have 4 or 5 columns to make less long column on website. Do you follow me? If not, my apology because my writing in grammar in English is my second language because I am Deaf, ASL is my first language as usual. Thank you for be patient with me. Psycho, I am still learning, I have been research around about PHP language, there are some I don't understand how it works, example - =>, =<, $i++, \n, %s, %n, \s...I haven't understand complete, but I am still progress to understand them.
  2. Hi everyone, I am still learning to write the code in PHP, it is not easy. I am learning how to use foreach and while array, but I haven't figured how to create the two or more columns, only I can do one column. Soon, I will have larger database coming in, I need to learn how to create few columns, instead of one column. Can anyone help me? not following in row, I rather to follow by columns. Thanks, Gary
  3. QuickOld Car, your code is working, stopping taking blank data when I submitted, thank you! but there is small problem - reload is still taking a blank data in textfield with $_GET because it will stay in textfield when it is reload page, then database will take this data in. So, I change to $_POST... Any advice?
  4. 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
  5. 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.
  6. 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.
  7. 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.
  8. 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>'; }
  9. 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.
  10. 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>
  11. 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.