Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Error - Escape String

Posted on 2011-02-18
4
Medium Priority
?
930 Views
Last Modified: 2012-05-11
I have a form that has been working great. It still works - person fills out the form, selects what pdf's they want. They submit - info stores in database, person gets an email with links to the pdf's and admin gets email saying which pdf's the person asked for.

Recently we have started getting this error
Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given in /home/visitmit/public_html/moreinfo.php on line 230
 and it repeats for other lines.

That line is mysql_real_escape_string($address, $link); and all other errors are the same line with their corresponding form field.
0
Comment
Question by:katlees
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
mcv22 earned 2000 total points
ID: 34930414
Something in the morinfo.php file is causing $link to become null. Try removing the second parameter altogether and see if that works
0
 

Author Comment

by:katlees
ID: 34930465
That fixed it... What would cause it to become null?
0
 
LVL 12

Expert Comment

by:mcv22
ID: 34930495
Can't tell without really looking at what the code does and the entire flow. You can use is_null to check $link and if true, re-initialize the connection. Adding additional debugging will help narrow down where it becomes null.
0
 

Expert Comment

by:fundraisinggold
ID: 34930528
if that link is being returned from a mysql_query, that usually means that the query didn't return any results.  If a query results in 0 records, then mysql_query returns false instead of an actual resource.
0

Featured Post

Major Serverless Shift

Comparison of major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question