Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 PHP/MySql assistance needed
Index -> Programming, PHP -> PHP Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wtd




PostPosted: Thu Jul 15, 2004 5:03 pm   Post subject: (No subject)

And for the love of Pete, man! Indent! Smile
Sponsor
Sponsor
Sponsor
sponsor
nickison99




PostPosted: Thu Jul 15, 2004 6:29 pm   Post subject: (No subject)

octopi wrote:
On your update line, why do you have single qoutes around the TABLENAME
and can you please describe the tables.
(Names, Fields/types)

you could try adding a
OR DIE
line to the end of the mysql_query
to see if it doesn't complete right, mysql_error should say why.

The table name that gets updated is "MainPlayerInfo" and the field that should be updated is "Team2005"(varchar(50) - will be char(2) later). The value that should be in there is the value from the pulldown menu named "New_Team2005". I have been tinkering with it for hours now and still cannot get it to work.
nickison99




PostPosted: Thu Jul 15, 2004 6:32 pm   Post subject: (No subject)

wtd wrote:
And for the love of Pete, man! Indent! Smile

Next time, If I need to post this again i will indent it. Whenever i start tinkering with code I don't care about the indentation until I get it to work. Very Happy
wtd




PostPosted: Thu Jul 15, 2004 6:33 pm   Post subject: (No subject)

nickison99 wrote:
wtd wrote:
And for the love of Pete, man! Indent! Smile

Next time, If I need to post this again i will indent it. Whenever i start tinkering with code I don't care about the indentation until I get it to work. Very Happy


You might just find you get it to work faster by making it easier to read. Wink
nickison99




PostPosted: Thu Jul 15, 2004 6:37 pm   Post subject: (No subject)

True - (indentation in progress...)
For future refrence is there a program that is good for php editing that includes and indent feature(like Turing)?
THanks.
Nick
wtd




PostPosted: Thu Jul 15, 2004 6:43 pm   Post subject: (No subject)

http://zend.com/store/evaluation.php?pid=77&download=1
octopi




PostPosted: Thu Jul 15, 2004 11:07 pm   Post subject: (No subject)

nik wrote:
$getteam = mysql_query("SELECT * FROM Teams2004 WHERE TeamID ='$play[Team2004]'");


okay, so why then are you trying to read data from the 'Teams2004' table?
nickison99




PostPosted: Fri Jul 16, 2004 11:36 am   Post subject: (No subject)

That chunk of code reads the persons team number (from MainPlayerInfo) and checks the teams table to see what team the team number refers to.
Sponsor
Sponsor
Sponsor
sponsor
octopi




PostPosted: Fri Jul 16, 2004 12:06 pm   Post subject: (No subject)

This part makes no sense, based on your other code.

WHERE Player_ID='$HTTP_GET_VARS[id]'
nickison99




PostPosted: Fri Jul 16, 2004 12:09 pm   Post subject: (No subject)

I made one change to the code:
code:
echo "<FORM METHOD=POST ACTION=editteams3.php>";

is now:
code:
echo "<FORM METHOD=POST ACTION=editteams3.php?id=$play[Player_ID]>";
.
octopi




PostPosted: Fri Jul 16, 2004 12:18 pm   Post subject: (No subject)

change

code:
Player_ID='$HTTP_GET_VARS[id]'



to

code:
Player_ID='$HTTP_POST_VARS[id]'


remove the
code:
.php?id=BLAH
from the action


add
code:
<input type=hidden name=id value=BLAH>


to your form.



Also read my other posts and follow the directions such as mysql_error()
tell me what those show, make sure that the update line is acctually being reached (does the
code:
if(isset($HTTP_POST_VARS['submit'])) {

acctually get reached.)

also give us a url of the hting, if you haven't already
nickison99




PostPosted: Fri Jul 16, 2004 12:24 pm   Post subject: (No subject)

Hi, Can we continue this through PM? There is some information on the site that I cannot give out so I would like to pm you the link instead.
nickison99




PostPosted: Fri Jul 16, 2004 1:26 pm   Post subject: (No subject)

Problem Fixed! Thanks to octopi and wtd for all their help!
Nick
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 28 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: