On Sunday 14 July 2002 03:43, Chip Wiegand wrote:
> > > $sql = "INSERT INTO legs
> > > (squats,squats_reps,legpress,legpress_reps,legext,legext_reps,legcurls,
> > > legcurls_reps,calfraise,calfraise_reps,hipabducter,hipabducter_reps,
> > > hipadducter,hipadducter_reps,comments) VALUES('$squats','$squats_reps',
> > > '$legpress','$legpress_reps','$legext','$legext_reps','$legcurls',
> > > '$legcurls_reps','$calfraise','$calfraise_reps','$hipabducter',
> > > '$hipabducter_reps','$hipadducter','$hipadducter_reps','$comments')";
> > echo $sql; # ???
> What does that do? And would I put it somewhere in my web page code?
> I've not seen this before.
That is _the_ most basic debugging procedure.
Print out the values of variables at strategic points in the code to find out
why something doesn't work as expected. In your case, as register_globals was
disabled, all your variables -- $squats, $squats_reps etc -- would have been
empty. Thus "echo $sql" would have immediately drawn your attention to this
fact, and explain _why_ your query didn't insert anything and would've given
you enough clue on _how_ to rectify the problem.
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
If a man loses his reverence for any part of life, he will lose his
reverence for all of life.
-- Albert Schweitzer
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php