99naa Posted October 1, 2006 Share Posted October 1, 2006 HiI have inserted a text file into a database field. When I executed the following query I get absolutly no result in the web page. The code is....[code]<?php //connect to the database include ("connect.php"); echo "<tr><td width='846' height='651' valign='top'><div align='center'><br>"; //get the about us file from the database $query = "select * from aboutus where aboutus ='$aboutus[$i]'"; $result = mysql_query($query) or die ("error"); //display the query results in a table while ($row = mysql_fetch_array($result)); { echo stripslashes($row['aboutus']); } mysql_close();?>[/code]the text file is called aboutus.txt, the table is called aboutus and the field is called aboutus.If anyone can put me onto the right track I would really appreciate it.Many thanks99 ;) Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/ Share on other sites More sharing options...
AndyB Posted October 1, 2006 Share Posted October 1, 2006 [quote author=99naa link=topic=110127.msg444569#msg444569 date=1159686948]I have inserted a text file into a database field. [/quote]I assume you mean you have inserted [i]the contents[/i] of a text file ...Where in your code does the value of $aboutus[$i] get set? Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/#findComment-101802 Share on other sites More sharing options...
shivabharat Posted October 1, 2006 Share Posted October 1, 2006 Ho whave you stored the text file? Whats the data type you used? Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/#findComment-101860 Share on other sites More sharing options...
99naa Posted October 2, 2006 Author Share Posted October 2, 2006 Well The problem I think is that the content of the text file is not sitting in the database properly. I have no idea where its being set.The file is stored as a .txt file. In the database the field data type is longblobI am a very raw beginner at this and of course jumping in the deep end. Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/#findComment-102095 Share on other sites More sharing options...
AndyB Posted October 2, 2006 Share Posted October 2, 2006 Does the database field named aboutus actually contain any data? If so, what? Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/#findComment-102236 Share on other sites More sharing options...
99naa Posted October 2, 2006 Author Share Posted October 2, 2006 yes, as far as I am certain, the field does contain data, when I do a query to show what is in that field I get 10 rows retuned. The field is containing text regarding the company, what they are about. Link to comment https://forums.phpfreaks.com/topic/22641-help-with-database-query/#findComment-102687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.