1,105,340 Community Members

Update query works on localhost but not on server

Member Avatar
Albert Pinto
Junior Poster in Training
69 posts since Jun 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi people, got some weird issue.

My update query isn't working once I upload my files on server, It works perfectly on localhost and delivers what its intended to do.

I echoed my update query

On local host it gave me:

UPDATE displayusertrip SET displaytripmnth='JAN', displaytripyr='2012', displaytriptrps=' Goa Trip, Bengal Trip,Kerala Trip, Manali Trip, Ooty Trip' WHERE displaytripid='1'

But after uploading on server, it gave:

UPDATE displayusertrip SET displaytripmnth='', displaytripyr='', displaytriptrps='' WHERE displaytripid='1'

Its just passing blank values....

I mean its same code, same tables, then how come it won't work on server if its working on localhost?

Anyone has encountered any similar issues in past.

Pls Reply...

Regards

Member Avatar
|-|x
Posting Whiz
353 posts since Apr 2008
Reputation Points: 113 [?]
Q&As Helped to Solve: 56 [?]
Skill Endorsements: 8 [?]
 
0
 

it can depend on many things including differing versions of software installed on the server and the development machine (such as PHP or mysql).

It could also be different database configuration, assuming you are reading from an existing table to gather the data for your updates.

I suggest checking for differences between server configuration and your development machine, as well as any table data that you are relying on for certain assumptions in code.

Beyond that, post your code and see if anyone can notice any discrepencies.

Member Avatar
Albert Pinto
Junior Poster in Training
69 posts since Jun 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanx for the reply Sir,

My updae query isn't working.... select and delete are fine....

I created a file ver.php to check the version and just inserted this code in it....

<?php

phpinfo();

?>

localhost php version is 5.2.6

But After uploading I went to the proper url but ver.php page is blank......

Member Avatar
vasvigupt
Newbie Poster
10 posts since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Just download the whole code that shows error. and again test it on your local machine..just ensure that If You dont have any little mistake in your code.

Member Avatar
sasankasekhar
Light Poster
35 posts since Jan 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

Just making a wild guess::
please check the method of the form or the names of the input/ select ... from the page/ file the data is posted.
Possible area of the error:
$_POST['month']
or something like that (May be the tagnames doesnot match).

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article