Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Sigmahokies

  • Rank

Recent Profile Visitors

4,069 profile views
  1. dsonesuk, i forget to add .=, it showed now. Thank you!
  2. Hi everyone, I'm trying to use PDO to insert data in database, seem none of them success, it just breakdown after I click button to submit. what did I do wrong? [php] <?php /* check to see connection is working */ if(isset($_POST['submit'])) { $server = "localhost"; $username = "Sigma"; $password = ""; $dbname = "Register"; try { $connect = new PDO ("mysql:host=$server;dbname=$dbname", $username, $password); } catch (PDOException $error){ echo $error->getMessage(); } /* Insert data into database */ $firsts =
  3. Hello everyone, I'm trying to get abbreviate states from plain text into HTML select and option, seem it's not working. Can you help me? here my PHP code: /* Read file to insert as option in HTML */ $file = fopen("States.txt","r") or exit("Unable to read"); while(!feof($file)) { $states = fgets($file); $statelist = "<option value='".$states."'>".$states."</option>"; } fclose($file); Then <tr><td>State:</td><td><select id="abb" name="abb"><?php echo $statelist ?></select></td>
  4. Never mind everyone, I found to make it work...I remove "action='[file]'" from HTML form. Thank you for effort
  5. Oh, I missed that part, I just changed that $updated from $update. Seem it doesn't work with update in database, it's result same. It haven't update...I think something is missing, I tried to use PHP tester, test showed it's fine. Very odd.
  6. No error is showing, all syntax are corrected. Only I see that data has not change when I entered the update a data in the database.
  7. Hi everyone, I need a help...I don't understand why it is not work. I'm trying to "update" data in database, but it couldn't do that. Maybe there is wrong script in PHP. Can you find what did I do wrong? //Edit data from database if(isset($_GET['edit'])) { $edit = $_GET['edit']; $update = "select * FROM sampleDB where ID = '$edit';"; $updated = mysqli_query($GaryDB, $update); $change = mysqli_fetch_assoc($updated); if($change) { $editted = "<tr><td colspan='4'><input type='text' name='update' value='".$change['ID']."' readonly>&l
  8. dsoneuk, You are right, it works now...thank you so much! Gary
  9. Hi everyone, I'm trying to display all record in php from database, there are three rows in phpmyadmin already, but why while won't print three rows? it just printed last row. what did I do wrong? I followed exactly from w3school's instruct, but it is still show last row, not all record. $show = "SELECT FirstName, LastName, City, State, TimeZone FROM sampleDB"; $query = mysqli_query($GaryDB, $show); if(mysqli_num_rows($query)) { while($row = mysqli_fetch_assoc($query)) { $display = "<tr><td>
  10. Sigmahokies

    PHP email

    Hi everyone, Can anyone help me underatdn why my email in php didn't work. I set up the email form in web, seem it didn't send at all. I put boolean with email, then I tested to fill out text to send email, then it said it didn't send email at all. What did I do wrong? <?php $error = ""; if($_SERVER['REQUEST_METHOD'] == "POST") { if (empty($_POST['email'])) { $error = "<tr><td colspan='2'>E-mail is required</td></tr>"; } elseif (empty($_POST['FirstName'])) { $error = "<tr><td colspan='2'>First Name is required</td></tr&
  11. Hi everyone, I'm wondering about Javascript and PHP allow to using same keyword with different reason, like using keyword word twice in html line. For example, I'm using keyword "name" in Javascript for count in adjust number, now, I'm trying to use keyword "name" for other reason, like undo all checked. Can use keywords more than one time? or cannot be done? Thanks, Sigmahokies
  12. Sigh...All right, you are not helpful. I will do other forum, I hope someone can help me.
  13. I'm still not get it...Maybe that "this" keyword is not useful. I'm not sure I understand, I thought "this" is good for pass variable to other class like other page.
  14. I'm not sure I get it about your last reply. I checked around about "this" keyword in Javascript...it's not clear to me.
  • Create New...