MySQL Longtext field retrieval using PHP...?
-
Hello all, I'm fairly new to MySQL and PHP! I have a mysql table called quotes where I'm storing articles and article information. There are 5 fields: Title varchar(255) Link varchar(255) Quote text Abstract text FullText mediumtext I am unable to retrieve any of the FullText. If I use the following code... $query = "SELECT Title, FullText FROM $usertable LIMIT 2"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $FullText = $row["FullText"]; $Title = $row["Title"]; echo "$Title<br>$FullText<br>"; } ...I get this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/b/i/o/bioshieldusa/html/si… on line 63. (Line 63 is the while statement) However, if I replace FullText with Quote or Abstract, everything works and displays just fine. Do I need to use a special method to extract mediumtext from the DB??
-
Answer:
The word FULLTEXT is a reserved word in MySQL, which is causing problems with your query. You will need to rename this field in order to make your queries work. I once used a field named DESC, it took me ages to figure this out. For a list of reserved words, see this page: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
bigbill at Yahoo! Answers Visit the source
Related Q & A:
- How To Build Business Directory Using Php Mysql?Best solution by Stack Overflow
- how delete node in xml file using php?Best solution by Stack Overflow
- How to read csv file using php?Best solution by Stack Overflow
- How to prevent duplicate entries in MySQL and PHP?Best solution by Stack Overflow
- How to write a query for PHP and MySQL?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.