Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. $get_option_query = 'SELECT id, name FROM catagory ORDER BY id'; $result_set=mysql_query($get_option_query) or die (An error has occured retrieving the information from the database : '.mysql_error()); echo '<select name="cat_choice">' while ($row = mysql_fetch_assoc($result_set){ echo '<option value="'.$row['id'].'">'.$row['name'].'</option>'; } echo '</select>'; Untested, but something like that should get you what you want.
  2. couple of things. why are you selecting * ? do you actualy need all the fields from both the tables? you didn't state what the connection between the tables was and you have no forign keys listed. Does commentstatus.shairid = wallposts.postid ? max size for a varchar field should be 255, that you were able to create that table with a value of 1000 is a bit surprising. if you want a field that size you need to use TEXT(1000). can you let us know what you want out of each of the tables as well as how they relate to each other so we can better help create the query?
  3. I think this is something you may want to contact payPal about. It is very likely that their system will flag a fraud alert if you impliment what you are planning.
  4. the one sight that you will be unable to live without for php is the manual site: http://php.net/manual/en/index.php mySQL also has one but it's kinda suckie compared to php's http://dev.mysql.com/doc/refman/5.1/en/ There is of cource a wealth of information here at phpFreaks as well, although finding it can some times be a bit tricky. I know a few of the more knowledgable types have a couple of guides floating about, and there are a few that would even make you one up if you ask nice enough (not me though, I suck at this stuff )
  5. Work with more tables, rather than more records. Also - make sure you index properly and use relevent table & field names, especialy for keys. If you are going to be generating the tables from the code as and when then you will want to have another table to index the table names ith other relevant information, such as creation date. Actualy - I hear taking classes works as well
  6. "It's not working" ? any chance of giving a little detail here? ever went to the doctor and said "I don't feel right" and have them fix the problem from that with no other input from you? @ Pikachu - you know they havn't echoed it out
  7. ahhh...the ol'd stray single quote in an echo statement... ...is not redirecting automatically or you [color=red]don't[/color] want to wait.
  8. @parino_ : you actualy read all that? I strated to loose focus when the variables were being assigned ...if only there was something in the forum post BBCode that would make it clearer and easier to read..... TOTALY agree though - there is no way on this plannet (or any other one that I have visited recently) that you (zanycyborg) could write that code and have never learned how to assign an array, or at the very least be in a possition get what you needed from the php manual.
  9. hoverinc, the SQL update statement will run through the entire table and update all records that match your where condition. That's how it works, always. Pikachu gave you the code you need to use. To do it the way that you are thinking about is way too complicated. Look into the SQL more.
  10. mysql_query("INSERT INTO 'admin'('','admin','password') VALUES('','$admin','$password');"); OK, when using INSERT you need to use the following syntax : INSERT INTO [table name] (field_name_1, field_name_2...) VALUES (value1, value2...) so: 1. you don't need to declare auto increment fields in the INSERT, and certainly don't declare them as an empty values 2. you don't need to use quotes or back ticks to enclose table names or field names that have no spaces in them. 3. always always have an or die statement when debugging sql queries that includes the mysql error as an output. So, that said, you should end up with something like this : $query = 'INSERT INTO admin (admin, password) VALUES (\''.$admin.'\', \''.$password.'\'); mysql_query($query) or die (mysql_error());
  11. I'm not sure I get exactly what it is that you want to do here. You are reffering to the same TABLE_PREFIX rather than giving an actual table name. could you post the table structure for each of the three tables you are using, with the fields you are looking for highlighted?
  12. are you trying to call SESSION_START() as a form action from your html form? If you are that may be part of the problem.
  13. read through the examples for preg_match() you will see the similarities to what you are using and should be able to fill in the blanks. I have never used it, so can't really comment on its application. although I am sure there are plenty that have.
  14. your going to need to provide more details regarding the information that is in the table
  15. ereg has been depreciated, it's not supported any more as of PHP 4. look into this: http://www.php.net/manual/en/ref.pcre.php
  16. lol c'mon admit it, your not sorry at all I had read that, it's just been a while, and I have only used it with row numbers, having always used assoc - that said, I did clearly get mixed up with mysql_fetch_row() and once again posted poor information. :'(
  17. could be wrong here, but I think your problem is: while($row = mysql_fetch_array($total_inches_result)) { mysql_fetch_assoc() would be the preffered call as I think that mysql_fetch_array stores each record in a set under it's field number (starting at zero) in the order that it selected by - also, I think it's been depriciated, not sure though. you can still use mysql_fetch_array() just change it to $row[0], $row[1] etc. P.S. : sorry for posting the wrong code, mikosiko was right, I missread your desired output.
  18. I personaly would make it a different query. SELECT SUM(news) AS TotalPosts FROM news GROUP BY news_id also, your seem to be selecting user_id twice, which you don't need to do.
  19. using this: SELECT SUM(size), name FROM s1 GROUP BY name ORDER BY size DESC LIMIT 1 you can get the first part of it (and angler A is 36 not 37). using this as a foundation, and applying it to the other fields in your table, you sould get the second part ok on your own. Any further problems post up your full table structure
  20. if(mysql_num_rows(mysql_query("SELECT userid FROM signup WHERE userid = '$userid LIMIT 1' "))) <-------------------(line 32) is your original code. You have wrapped the LIMIT 1 inside the single quotes, which will result in an error in the sql. try something like this: $qry = 'SELECT userid FROM signup WHERE userid = "'.$userid.'" LIMIT 1'; $result = mysql_query($qry) or die ('Error in the SQL SELECT QUERY! : '.mysql_error()); if(mysql_num_rows($result) > 0 ){ //your error code here }
  21. Have you tried a print_r() on the $userfile['error'] to see what the value is?
  22. can we get a look at your connection string please?
  23. that's what I get for copying and pasting this should work better SELECT wp_bp_groups.name, wp_bp_xprofile_data.value FROM wp_bp_groups RIGHT JOIN wp_bp_xprofile_data ON (wp_bp_groups.id = wp_bp_xprofile_data.user_id)
  24. :wtf:Your not actualy serious are you? I don't think there is an adjective in any langauge that cover this level of stupidity....You can't seriously think that you can just make a couple half assed posts and people will fall over each other to write YOUR code for you?
×
×
  • 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.