Jump to content

Search the Community

Showing results for tags 'data retrieval'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Ok so more on my lil comic app... (and all was going so well) GOAL: Trying to take a value from a form and create sql statement to look for that comic title in the DB and show what has been entered. (I.E search for Spider-Man -> Shows all Rows that Pertain to Spider-Man) So I can't figure out what is wrong with my code. Soon as I enter in my while statement my php failes however my query seems to be doing just fine. I've used the same kind of template on other pages and it works just fine the only difference is when I added a WHERE statement to my sql query. * NOTE: If I take the output of my query and plug it into mysql workbench I get the correct tables and results so I'm yeah kinda confused. * NOTE: The way I retrieve the $data variable is from a query from the form page which pulls all the comic names from the DB and displays in a drop down so the values that it passes are the exact same names / titles from the DB itself. <?php require('./scripts/con_db.php'); // Query DB for Comic_Names // $data = $_POST['comic_name']; $query = "SELECT * FROM `comic_db`.`comic_db` WHERE `comic_name`='$data'"; $com_sql = mysqli_query($comic_connect, $query); if (!$com_sql){ echo "Failed to connect to db" . mysqli_errorno(); } ?> <body> <p align="center"><img src="./images/comic_front.png" /></p> <table align="center"> <tr> <?php while($row = mysqli_fetch_array($com_sql)) { echo "<td>" .$row "</td>"; } ?> </tr> </table> <br /> <br /> <?php require('./scripts/footer.php'); ?> I should also say i've tried these other passes as well with no luck : <?php while($row = mysqli_fetch_assoc($com_sql)) { echo "<td>" .$row "</td>"; } ?> while($row = mysqli_fetch_assoc($com_sql)) { echo "<td>" .$row['comic_name'] "</td>"; } ?> <?php while($row = mysqli_fetch_assoc($com_sql)) { echo "<td>" .$row['$data'] "</td>"; } ?> I've also tried something I found in a book that says to do extract($row) then do my echo "<td>" .$row "</td>"; but that didn't work either so I'm missing something here is what the output for the SELECT string gives me as well from the browser which seems to be fine and again if I plug into mysql workbench it displays what I need.. SELECT * FROM `comic_db`.`comic_db` WHERE `comic_name`='Iron Man - V5' TY for help guys I've try to keep the ??'s down but I'm missing something (probably pretty obvious) so I need some guidence.
×
×
  • 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.