We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,153 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Update query works on localhost but not on server

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

4
Contributors
4
Replies
4 Days
Discussion Span
11 Months Ago
Last Updated
5
Views
Albert Pinto
Junior Poster in Training
58 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

Hearth
Posting Whiz
302 posts since Apr 2008
Reputation Points: 123
Solved Threads: 44
Skill Endorsements: 4

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......

Albert Pinto
Junior Poster in Training
58 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

vasvigupt
Newbie Poster
9 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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).

sasankasekhar
Light Poster
35 posts since Jan 2007
Reputation Points: 10
Solved Threads: 5
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0814 seconds using 2.74MB