CloudBreaker Posted July 25, 2015 Share Posted July 25, 2015 Maybe it's just late, but I can't see the undefined variables. I'm trying to list the files that have just been uploaded. <?php //if(isset($_row['upload_file'])){ $s = "SELECT rfi_files.id,rfi_files.rfi_id,rfi_files.rfi_fileName\n" . "FROM rfi_files\n" . "where rfi_files.rfi_id='$project_id'" . "AND rfi_files.rfi_fileName='$rfiFilename'" . "\n" . ""; $result=mysqli_query($conn,$s); $row=mysqli_fetch_assoc($result); $i=0; $run = mysqli_query($conn, $s); while($row=mysqli_fetch_array($run)){ $rfiFileid =$row["rfi_id"]; $rfiFilename =$row["rfi_fileName"]; $i++; } ?> <div><strong><u>Uploaded Files:<u></strong></div><br> <div id="files"><a href="rfi_files/<?php echo $rfiFilename;?>"><?php echo $rfiFilename;?></a></div> <?php } ?> <div><!--end of container--> </body> ( ! ) Notice: Undefined variable: rfiFilename in B:\Programs\wamp\www\hsa\new_rfi.php on line 246 Call Stack # Time Memory Function Location 1 0.0018 278168 {main}( ) ..\new_rfi.php:0 Uploaded Files: ( ! ) Notice: Undefined variable: rfiFilename in B:\Programs\wamp\www\hsa\new_rfi.php on line 268 Call Stack #TimeMemoryFunctionLocation 10.0018278168{main}( )..\new_rfi.php:0 "> ( ! ) Notice: Undefined variable: rfiFilename in B:\Programs\wamp\www\hsa\new_rfi.php on line 268 Call Stack # Time Memory Function Location 1 0.0018 278168 {main}( ) ..\new_rfi.php:0 Quote Link to comment https://forums.phpfreaks.com/topic/297462-undefined-variablesi-cant-see-it/ Share on other sites More sharing options...
Solution requinix Posted July 25, 2015 Solution Share Posted July 25, 2015 It's right there in your $s query. Why do you think they're defined at that point? You do define them later on, that's true, but it doesn't help $s. Quote Link to comment https://forums.phpfreaks.com/topic/297462-undefined-variablesi-cant-see-it/#findComment-1517328 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.