Jump to content

akitchin

Staff Alumni
  • Posts

    2,515
  • Joined

  • Last visited

    Never

Everything posted by akitchin

  1. you can assign foreign keys using the InnoDB engine. i haven't read enough to know whether changing the value in the parent table changes the value in the child table, but i DO know you can specify delete activity (Cascade deletion, Nullify, etc.). have a look in the MySQL manual for InnoDB documentation. i think there's a whole chapter on the engine.
  2. as it says, the error is on line 4. you're breaking out of your query definition prematurely by using double quotes. change: $query_entjanRS = "SELECT * FROM entertainment WHERE entertainment.`date`>="2005-01-01" AND`date`<="2005-01-31" ORDER BY entertainment.`date`"; to: $query_entjanRS = "SELECT * FROM entertainment WHERE date>='2005-01-01' AND date<='2005-01-31' ORDER BY date"; when selecting everything from one table, you don't need table designation in your field designations.
  3. yea, i use a text editor (editpad) too. it's just a lot easier to amend your errors when you know where everything is and how it's working. Frontpage can lick my musky yams. it's like the "special olympics" category for web design/development.
  4. i've seen this error pop up time and time again, and the answer is ALWAYS the same. please look here before you post it. the problem is you are outputting to the browser (whitespace included) before sending a header. this is unallowed. remove output prior to the header, or use OUTPUT BUFFERING. NEW EDIT TO THIS TOPIC: what usually results in these errors is poor script design. when one processes a form, they should do it BEFORE OUTPUTTING ANYTHING TO THE BROWSER. there is NO reason that the process cannot be operated in the header of the document, before any HTML is output. let's take a common example. the programmer wants a login form which checks the username and password against the database. if they don't match, then don't set a cookie remembering them and tell them it failed. if they do match, set the cookie and send them to a member page. many will do: [php processing the form] [form code] because they can simply echo any errors straight from PHP right above that form. they can also send a success message, set the cookie, and header() them off on their merry way without seeing the form again. it's a logical place to put this code. think again. you'll (perhaps not so) obviously get header errors when you go to use setcookie() and header(). if the login fails, it's dandy, but if you have a successful login the user gets nowhere. answer: put the processing in the header, and store the results in variables. perhaps a $result variable that is 1 if successful, 0 if failed. then $output that contains either a success message or customized error messages. the new code would look like: [php processing the form (if it was sent) and storing the results] [html starting the page and layout] [php echoing the results] [form code if failed - exit(); if successful] this will solve your header errors and will make for much more maintainable and readable code. if you want to redirect them elegantly (with a success message), use a <meta> refresh redirect. header() should only be used in instances where instant redirection is desired.
  5. haha thanks, i shoulda known there\'d be documentation on the apache site. :oops:
  6. hey, i\'ve got my .htaccess and .htpasswd files all ready to go, and i\'ve put them into the directory i\'d like to have http authorization in. my only question is - are there settings in the apache httpd.conf file that i need to change for it to recognize these files? because at the moment, it won\'t use those files to protect the directory. andrew
  7. you could add the LIMIT 5 clause. i think this limits the results to 5 rows.
  8. if youre using $query = \"Select * from users where username = \'$username\'\"; go like this: $info = mysql_fetch_array(mysql_query($query)) or die(mysql_error()); $username = $info[\'username\']; $real_name = $info[\'real_name\']; $age = $info[\'age\']; $sex = $info[\'sex\']; the row that you select goes into the $info array, which you can then split up into various variables.
  9. one minor correction to that second query: \"SELECT * FROM table_name WHERE issue_numer != \'$current_issue\'\";
  10. ok, well if it\'s a problem with debugging, it\'s likely that dreamweaver isn\'t the problem, if you\'re entering all your own code. it\'s likely the php.ini error_reporting setting or something. check that first.
  11. thanks shiva, that was perfect. cheers.
  12. i know this may sound stupid, but how can i check the structure of a table without selecting anything from the table. i can\'t remember exactly what fields ive got, but selecting anything throws it out of proportion. and my msdos window wont scroll up.
  13. akitchin

    3d table

    why not make an index table, giving each user a specific id - then on another table where you want 50 rows and 51 fields per user, make one column user_id which can have 50 rows with the id 1, for user 1. not sure if i\'ve been clear enough. here\'s a bit of a diagram: table 1 - user index id username 1 user1 2 user2 ------------------------ table 2 - user info user_id row field 1 1 456456464 1 2 897897897 etc etc
  14. i dont know how you have them stored, but to output certain values as defaults in various fields it would be: echo "<input type="text" value="".$defaultvalue."" />"; echo "<textarea rows="5" cols="50">".$defaultvalue."</textarea>"; as long as the values you wish to set as defaults are in the $defaultvalue variable
  15. add quotes (\") around your SELECT statement like so: $login = mysql_query(\"SELECT * FROM users WHERE username =\'$username\' AND password =\'password\'\");
  16. you can define your root directory with <base href=\"Y:toto_folder\"> in the <head></head> section. then your links can look like: <a href=\"toto.html\"> hope that helps.
  17. and just for mention, does mysql_close($connection) actually close persistent connections? i read somewhere that it doesn\'t, but if that\'s the case, how do you close the connection?
  18. did you try to manually delete all the files and folders first? if so, you\'re just going to have to continue removing it that way, even though it leaves very messy ends around.
  19. just go into control panel and add/remove programs. the entire uninstall should work from there. youll have to make sure youre not running a standalone version of mysqld.exe though. if so, ctrl+alt+del end the program first, then proceed to remove it thru control panel.
  20. it seems to me your insert syntax is wrong. try this: INSERT INTO users(columnname1, columnname2) VALUES(\'$field1\', \'$field2\') lemme know if it works
  21. include the POST and SESSION values like you would with any other variable (without the string concatenation), and encase the variables in braces like so: {$_POST[\'value\']} if you don\'t like that idea, you can always localize the variables by going: $value = $_POST[\'value\']; and including it in your queries like so: WHERE idclinic_dblog=\'$value\' hope this helps, i ran into these problems too.
  22. i\'ve had difficulties including $_POST variables in mysql queries before. see if this helps: $search = $_POST[\'textfield\']; $result = mysql_query("SELECT * FROM elementary WHERE location LIKE \'%$search%\'", $mylink); cheers
  23. if i were you, i would learn all your coding, and learn to do it by hand. if you depend on programs all the time, you will soon run into problems when you want to customize pre-existing things, and when you want to make complex websites. you will find you get better at not leaving loose ends lying around in your code, and you will be in much better control of how your page looks and reacts.
×
×
  • 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.