PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

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 Dev Shed Forums Sponsor:
  #1  
Old November 6th, 2012, 10:07 AM
Fgatlin Fgatlin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 17 Fgatlin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 36 m 33 sec
Reputation Power: 0
Updating MySQL not working, but Sessions works fine

I am trying to update one of my tables to collect a number.
The Sessions portion works as expected, but nothing is being updated in the database.

PHP Code:
function shwAddTaxCertForm(){
            

        
$retBuffer "";

        
$con mysql_connect("xxxxxxxxx","xxxx","xxxxxxxx");
            if (!
$con)
          {
            die(
'Could not connect: ' mysql_error());
           }

            
mysql_select_db("xxxx"$con);
    
        if(isset(
$_POST['Submit'])){
            
$location mysql_real_escape_string($_POST['inpTaxCertNo']);
            
$tbl_name="ord_accounts";
            
$sql="UPDATE $tbl_name SET tax_exempt='$location' WHERE id='$accId'";
            
$result=mysql_query($sql);
            }

        
$retCertCode simpleQueryString(gine("inpTaxCertNo"), "");

        if(!empty(
$retCertCode)){

            if(
$retCertCode == "remove"){

                
$_SESSION['taxcert'] = "";

                unset(
$_SESSION['taxcert']);

                
header("Location: ?action=ordconf");

                die(
"Please continue to: <a href=\"?action=ordconf\">checkout</a>");

            }

            
$retBuffer .= "

                <p class=\"genPError\">

                    Tax cert received, please continue with your <a href=\"?action=ordconf\">checkout</a>.

                </p>"
;

            
$_SESSION['taxcert'] = $retCertCode;

            
header("Location: ?action=ordconf");

        }
        





        

        
$retBuffer .= "

            <div class=\"checkoutPageWrapper\">

                <h2>Florida Tax Exemption Certificate</h2>

                <form action=\"?action=addtaxcert\" method=\"post\">

                    <div class=\"locListAnnot\" style=\"text-align: center;font-size: 1.15em;\">

                        To place an order with a Florida address without having sales<br />

                        tax added to your order's total, your company must provide an<br />

                        active Florida Resale or Exemption Certificate.<br />

                        <br />

                        Entries will be verified through the <a href=\"http://dor.myflorida.com/dor/gta.html\">Florida Department of Revenue</a><br />

                        website. Customers who's certificates can not be verified will be<br />

                        contacted to verify details before an order may ship.<br />

                        <br />

                        <span style=\"font-size: 0.8em;font-weight: bold;color: #2158A9;\">

                            <label for=\"inpTaxCertNo\">Florida Certificate Number:</label><br />

                        </span>

                        <input type=\"text\" value=\"\" name=\"inpTaxCertNo\" id=\"inpTaxCertNo\" />

                        <br />

                    </div>

                    <div class=\"locListAnnot\" style=\"text-align: center;font-size: 1.15em;\">

                        <br />

                        

                        <input type=\"submit\" id=\"Submit\" name=\"Submit\" style=\"font-size: 1.15em\" value=\"Continue\" /><br />

                        <a href=\"?action=ordconf\">[Cancel]</a><br />

                        <br />

                    </div>

                </form>

            </div>"
;

        

        return 
$retBuffer;

    } 


Any suggestions?
Thanks

Reply With Quote
  #2  
Old November 6th, 2012, 10:16 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,809 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 18 h 5 m 25 sec
Reputation Power: 6112
Did you debug this on your own? Did you echo the query to see what could be wrong with it? I'm betting you didn't, since $accID isn't set.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
  #3  
Old November 6th, 2012, 10:17 AM
Jacques1's Avatar
Jacques1 Jacques1 is offline
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,870 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 22 m 32 sec
Reputation Power: 813
Hi,

the variable $accId isn't defined anywhere.

By the way, the first thing you should do when you have a problem with a query is output the query and see what it actually looks like.

Reply With Quote
  #4  
Old November 6th, 2012, 11:28 AM
Fgatlin Fgatlin is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 17 Fgatlin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 36 m 33 sec
Reputation Power: 0
Perfect, Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Updating MySQL not working, but Sessions works fine

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap