User Profile

Collapse

Profile Sidebar

Collapse
mike6256
mike6256
Last Activity: Feb 28 '09, 05:30 PM
Joined: Feb 25 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mike6256
    replied to Displaying a single image and data
    in PHP
    AWSOME--That did the trick!!!! Thanks for ALL the help
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    added the quotes--now get:
    PHP Parse error: parse error in C:\Inetpub\wwwr oot\tlsc\list_f iles.php on line 17 here are lines 12 - 17
    Code:
    $result = mysqli_query($dbLink,   
      "SELECT FileID, FileName, FileMime,   
      FileSize, ToolNumber, Created   
      FROM FileStorage   
      WHERE ToolNumber =   
      '" . mysqli_real_escape_string($dbLink,$textfield) . "'";
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    sorry about the tags

    here is the code--let me know if I did it correct

    Code:
     <?php 
    # Connect to the database 
    $dbLink = mysqli_connect("71.39.54.10", "root", "trinidad", "tools"); 
    if(mysqli_connect_errno()) { 
        die("MySQL connection failed: ". mysqli_connect_error()); 
    } 
      
    # Query for a list of all existing files
    ...
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    how do I do code tags??
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Guess what--more errors

    PHP Parse error: parse error in C:\Inetpub\wwwr oot\tlsc\list_f iles.php on line 21

    here are lines 21 thru 70
    Code:
    if($result)  
    { 
      
        # Make sure there are some files in there 
        if(mysqli_num_rows($result) == 0) { 
            echo "<p>There are no files in the database</p>"; 
        } 
        else 
        {
    ...
    See more | Go to post
    Last edited by Markus; Feb 26 '09, 08:51 PM. Reason: Added [code] tags.

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Back again--got this error:

    There are no files in the database

    PHP Warning: mysqli_real_esc ape_string() expects exactly 2 parameters, 1 given in C:\Inetpub\wwwr oot\tlsc\list_f iles.php on line 17


    do I need to do something like this

    Code:
    "SELECT FileID, FileName, FileMime,  
      FileSize, ToolNumber, Created  
      FROM FileStorage  
      WHERE id= '$id'
    AND ToolNumber
    ...
    See more | Go to post
    Last edited by Markus; Feb 26 '09, 08:40 PM. Reason: Added [code] tags.

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Not quite sure I undestand-- can you explain a little and/or give a example?
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    well I tried:

    '" . mysql_real_esca pe_string($text field) . "'");

    as reccommended- but get:

    There are no files in the database

    PHP Warning: mysql_real_esca pe_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localho st' (using password: NO) in C:\Inetpub\wwwr oot\tlsc\list_f iles.php on line 12 PHP Warning: mysql_real_esca pe_string() [function.mysql-real-escape-string]:...
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Well I did the reccommended changes and now get another error:



    This is line 12:

    Code:
    $result = mysqli_query($dbLink, "SELECT FileID, FileName, FileMime, FileSize, ToolNumber, Created FROM FileStorage WHERE ToolNumber = " . mysql_real_escape_string($textfield));
    ...
    See more | Go to post
    Last edited by Markus; Feb 26 '09, 05:46 PM. Reason: Added [code] and [quote] tags.

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    would something like this work?

    Code:
    $textfield = $_POST['textfield']; 
      
    $result = mysqli_query($dbLink, "SELECT FileID, FileName, FileMime, FileSize, ToolNumber, Created FROM FileStorage WHERE ToolNumber = " . mysql_real_escape_string($textfield));
    here is the code for the search

    Code:
    <form id="form1" name="form1" method="get" action="list_files.php">
    ...
    See more | Go to post
    Last edited by Markus; Feb 26 '09, 03:55 PM. Reason: Added [code] tags.

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    here is the code I am using that gives me undefined variable error

    Code:
    <?php 
    # Connect to the database 
    $dbLink = mysqli_connect("xx.xx.xx.xx", "xxxxx", "xxxxxxxx", "tools"); 
    if(mysqli_connect_errno()) { 
        die("MySQL connection failed: ". mysqli_connect_error()); 
    } 
      
    # Query for a list of all existing files 
    $result = mysqli_query($dbLink,
    ...
    See more | Go to post
    Last edited by Markus; Feb 26 '09, 03:51 PM. Reason: Added [code] tags.

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    I tried it with the $ variable but get a undefined variable error
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Thanks for the rapid reply
    I did find That Toolnumber should be ToolNumber-corrected it but still the same
    will 'textfield' pull over from my search page?
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Thanks for the WHERE clause link--I gave it a shot but get the result "There are no files in database" any advice for a rookie?
    # Query for existing files
    $result = mysqli_query($d bLink, "SELECT FileID, FileName, FileMime, FileSize, ToolNumber Created FROM FileStorage Where Toolnumber = 'textfield' ");
    See more | Go to post

    Leave a comment:


  • mike6256
    replied to Displaying a single image and data
    in PHP
    Sorry-here is the link
    http://bytes.com/topic/php/insights/...base-using-php...
    See more | Go to post

    Leave a comment:


  • mike6256
    started a topic Displaying a single image and data
    in PHP

    Displaying a single image and data

    Hi all
    I am extremely new to php and need some help

    I found a code that Atli addressed in a 11/23/07 thread and have been working with it-all is great. My main question is how do I search for a single file and display the image for that single file. The code example by Atli will list all files

    Thanks
    See more | Go to post
No activity results to display
Show More
Working...