User Profile
Collapse
-
AWSOME--That did the trick!!!! Thanks for ALL the help -
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) . "'";
Leave a comment:
-
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
Leave a comment:
-
-
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 {
Leave a comment:
-
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
Leave a comment:
-
Not quite sure I undestand-- can you explain a little and/or give a example?Leave a comment:
-
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]:...Leave a comment:
-
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));
Leave a comment:
-
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));
Code:<form id="form1" name="form1" method="get" action="list_files.php">
Leave a comment:
-
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,
Leave a comment:
-
I tried it with the $ variable but get a undefined variable errorLeave a comment:
-
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?Leave a comment:
-
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' ");Leave a comment:
-
-
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
No activity results to display
Show More
Leave a comment: