Jump to content

cjkent17

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cjkent17's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i know how to use it, i just made a whole site without realizing i needed to release all the results, which means i gotta go through every single page, find every single query (and there is a lot of them, over 40 pages) that is stored in a variable array and free them after they have finished being useful. i basically just want to know if there is any way to go to the end of each page and just type for example (don\'t try this, it doesn\'t work) mysql_free_result(*); and that way it would free all of them at once. i just mainly want to know if i can save myself a lot of time and patience doing it an easy way rather than find out after i did it all
  2. I was wondering if the mysql_free_result(int result); function can be used with a wildcard (ie, so it free\'s all results without you having to type each of the names in)?
  3. the $data = $_POST[\'data\']; that that guy is referring to means that the you might not have register_globals turned on in his/her php.ini file. If you don\'t have it on, it would tell you that it couldn\'t find the variable that you are referring to., if it doesn\'t do this, don\'t worry about it, if it does, then you need to either turn register globals on (if you can) or make sure every variable you are trying to turn on is initialized first, as in: [php:1:135977b415]<?php $howold=$_POST[\'howold\']; $havepark=$_POST[\'havepark\']; ?>[/php:1:135977b415] etc. as for the original problem, try and change your code to: [php:1:135977b415]<?php $db = mysql_connect($host, $user, $pass); mysql_select_db($dbname,$db); $inserted = mysql_query(\"INSERT INTO `survey_readerstudy` (`howold`,`havepark`,`fampark`,`email_address`) VALUES (\'$howold\', \'$havepark\', \'$fampark\', \'$email_address\')\",$db) or die (mysql_error()); ?>[/php:1:135977b415] that way if any error results in stopping the db from inserting the record, it will stop the page right then and there and output the error message. if you want your page to continue only if it inserts, do this: [php:1:135977b415]<?php if ($inserted) { // this is the query variable of your insert into query // insert your successful code } elseif (!$inserted) { // output your error message here } ?>[/php:1:135977b415] hope this helps
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.