Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 4th, 2003, 01:23 PM
Samba Samba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 Samba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
troubles submitting

I have a student database for a boarding school setup and I made a login for all the parents and I put notes so they can communicate with us and it gets displayed when they login. So we can message each other. Kinda like a private message board. However when you click submit it only submites sometimes. I can't figure it out. It's like it only works when it wants. I don't even know where to start with this problem. Anyone had this type of problem?

Reply With Quote
  #2  
Old August 4th, 2003, 01:42 PM
Samba Samba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 Samba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: troubles submitting

if (isset($_GET['teen']))
$_SESSION['teen'] = $_GET['teen'];
if (isset($addnote)) {
$addnotequery=
"INSERT INTO leads_notes (company_id, lead_id, note, date_time)
VALUES ('".$_SESSION['company']."', '".$_SESSION['teen']."', '".str_replace("'","'",$note)."', NOW())";
mysql_query($addnotequery);
}






That is the code to add a note from a forum. it has some more stuff. but that is the main thing. anyone see a problem?

Reply With Quote
  #3  
Old August 4th, 2003, 05:04 PM
jaltiere jaltiere is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 55 jaltiere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via AIM to jaltiere
RE: troubles submitting

I'm not sure where things are going wrong for you, but I can offer a few suggestions.

1. Make sure you use mysql_escape_string on any strings that you are trying to insert into the database. Characters like ' can really screw things up.

2. print out $addnotequery while you are testing and see if a MySQL syntax error is causing your problem. You will at least be able to see which values are causing the query to fail.

Good luck.

Reply With Quote
  #4  
Old August 4th, 2003, 05:15 PM
Samba Samba is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 3 Samba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: troubles submitting

where should i put those in?

Reply With Quote
  #5  
Old August 4th, 2003, 05:30 PM
jaltiere jaltiere is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 55 jaltiere User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via AIM to jaltiere
RE: troubles submitting

Make sure you put the mysql_escape_string function in before the insert. All that function does is takes care of all of the escape characters to make the string ready to insert into a MySQL database.

For example, I would add a layer before the insert....something like this:

Code:
$str_company = mysql_escape_string($_SESSION['company']);


Do the same thing for every string being inserted...and instead of inserting $_SESSION['company'] you would use $str_company.

Then if you are still having problems you can just print out the SQL statement to the screen. You can do this either before or after the insert to see what the exact query was that you were trying to run. Make sure to remove it or comment it out when you have things figured out though so the end user doesn't get confused.


Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > troubles submitting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek