Jump to content

vet911

Members
  • Content Count

    100
  • Joined

  • Last visited

Community Reputation

0 Neutral

About vet911

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Thanks for the comment. I finally figured it out. try { echo "<br>"; foreach($dbh->query("SELECT * FROM test_shot WHERE testshot=1 ORDER BY year ASC") as $row) { echo "<div class='image-holder'><img src ='".$row['picture']."' width=300px /><br><a> ".$row['year']." ".$row['description']." </a>"; if($row['sold'] == 1) { echo "<img src='images/sold1.png'></div>"; } elseif ($row['sold'] == 0) { echo "</div>"; } } } catch (PDOException $e) { print $e->getMessag
  2. try { echo "<br>"; foreach($dbh->query("SELECT * FROM test_shot WHERE sold=1 ORDER BY year ASC") as $row) { if($row['picture'] != "" && $row['picture'] != null) { echo "<div class='image-holder'><img src ='".$row['picture']."' width=300px /><br>"; } if($row['year'] != "" && $row['year'] != null) { echo $row['year']; } if($row['description'] != "" && $row['description'] != null) { echo $row['description']; } if($row['sold'] == 1) { echo "<img
  3. That is what I figured out because when I took it back out of the code it was working as before. I haven't been able to figure it out sense. I'll continue to work at it some more. Thanks
  4. I did get an error message: 500 Internal Server Error. I removed the important info from the paypal hidden stuff. What I tried to do was check the $row['sold'] value to see if it was sold. 1= sold, 0 = not sold. It works, but not the way I would like. I was trying some different things that's why the commented out stuff.
  5. $result = $dbh->query($sql); if($result) { $i = 0; $max_columns = 3; foreach ($result as $row) { // open row if counter is zero if($i == 0) { echo "<tr VALIGN='top'>"; } // if ($row['avail'] != "0") //{ // make sure we have a valid product ALIGN='CENTER' if($row['image'] != "" && $row['image'] != null) { echo "<td><div class=box><a href=$row[image] rel=lightbox title=$row[image]><img class=border src=$row[image]>"; if($row['itemno'] != "
  6. I have to say you are the man. I have looked at that sense this morning when I made the post about being lost. I can honestly say I did not see those dollar signs. I appreciate all your help. Something else has been in my thoughts, I have a sign up page and after you login it brings you to a form which is blank. I want people to be able to change their own stuff. If they did it right the would have to fill out, name address, city, state, phone before they cold save that page without filling in the rest of the form. What I'm thinking, is there a way to see if they filled out the partial requi
  7. Ok so this is what I have now. <?php try { { /*** mysql hostname ***/ $hostname = 'localhost'; /*** mysql username ***/ $username = 'xxxx'; /*** mysql password ***/ $password = ''; $dbname = 'dblogin'; $dhb = null; $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $dbh->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true ); /***echo a message saying we have connected***/ echo "connected"; $get_id=$_REQUEST['id']; $registerStmt = $dbh->prepare('
  8. Thanks for the reply, like the Bobby Tables but still lost on how to do it. I'm really lost.
  9. This is the error I'm getting. Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'xxx', desc2 ='xx', desc3 ='x' WHERE id = '1'' at line 15' in This is my code: require_once('connect.php'); $get_id=$_REQUEST['id']; $fname = $_POST['fname']; $lname = $_POST['lname']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $phone = $_POST['phone']; $large =
  10. Hi, I found out the problem, the error was generating and shown at the bottom of the page. I have sense figured out that the password was incorrect. I changed that and now it works. I want to correct the script so it's not supplying directly to the database as mentioned in the reply from "benanamen" but not sure how to do that. Do I have to remove the script from the form page and have the form call the script to insert the data to the database? I have done this before but not recently. Any help would be appreciated. Thanks to all who replied.
  11. This is what is shown in the html file after the process completes. <script src="bootstrap/js/bootstrap.min.js"></script> SQLSTATE[HY000] [1045] Access denied for user 'xxxxxx'@'localhost' (using password: YES) </body> </html>
  12. I'm not seeing any error messages. The page refreshes back to the blank form. Thanks for the feedback.
  13. I have enclosed all the form below, this worked fine on localhost that's why I was surprised it didn't work. <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" media="screen"> <script type="text/javascript" src="jquery-1.11.3-jquery.min.js"></script> <link rel="stylesheet" href="style.css" type="text/css" /> <link rel="stylesheet" hr
  14. I'm having trouble sending data to database, nothing apprear in table and no error messages. Below is the file I'm using. <?php error_reporting(E_ALL); ini_set('display_errors', '1'); if(isset($_POST["submit"])){ $hostname='xxxxxx'; $username='xxxxxx'; $password='xxxx'; try { $dbh = new PDO("mysql:host=$hostname;dbname=dblogin",$username,$password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line $sql = "INSERT INTO register (fname, lname, address, city, state, zip, phone, large, lsize, lmatl, medium, msize, mmatl, small, ss
×
×
  • 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.