-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
How to use hyperlinks in a statement ?
Muddy_Funster replied to shenagsandnags's topic in MySQL Help
$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. -
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?
-
help with loop for Paypal DoDirectPayment API integration
Muddy_Funster replied to APuppyDog's topic in PHP Coding Help
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. -
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 )
-
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
-
more complicated "select from where and or" statement
Muddy_Funster replied to pioneerx01's topic in PHP Coding Help
"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 -
Unable to Validate the login information
Muddy_Funster replied to Jinidoc's topic in PHP Coding Help
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. -
@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.
-
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());
-
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?
-
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.
-
your going to need to provide more details regarding the information that is in the table
-
Find the largest value for each group and sum
Muddy_Funster replied to Skipjackrick's topic in MySQL Help
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. :'( -
Find the largest value for each group and sum
Muddy_Funster replied to Skipjackrick's topic in MySQL Help
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. -
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.
-
Find the largest value for each group and sum
Muddy_Funster replied to Skipjackrick's topic in MySQL Help
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 -
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 }
-
Have you tried a print_r() on the $userfile['error'] to see what the value is?
-
Beginner: Help on PhpMyAdmin MySql error "NO PASSWORD"
Muddy_Funster replied to bugzy's topic in MySQL Help
can we get a look at your connection string please? -
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)
-
: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?