Jump to content

SergeiSS

Members
  • Posts

    239
  • Joined

  • Last visited

Everything posted by SergeiSS

  1. Yes, it's true... It selects all rows where (meta_key = 'wp_s2member_custom_fields' or meta_key = 'wp_capabilities') - do you understand this condition??? AND in the same time user_id is contained in this selection "(SELECT user_id FROM wp_usermeta WHERE meta_value LIKE '%s2member_level%')". It seems that you don't like to think... You even can't say what do you like to get. OK, I hope you will start to think and find a solution for you task. Now it seems you don't know what do you like I can't help such a person. Sorry, but I leave this topic.
  2. Did you try it or just thinking? I just add one more condition to you first query (I mean first query in this topic).
  3. You see... I don't like to go deep into your thoughts... But I can help you in another way. If you like I can send you my own Erlang calculator (EXE file). If you find it useful I can give you the code - it's written in C+++Builder. You may rewrite it in PHP, it's easy to do Give me you e-mail.
  4. OK... Try this SELECT * FROM wp_usermeta WHERE (meta_key = 'wp_s2member_custom_fields' or meta_key = 'wp_capabilities') AND user_id IN (SELECT user_id FROM wp_usermeta WHERE meta_value LIKE '%s2member_level%')
  5. In the beginning you told about 1 or 2 rows... Why do you have now 19 rows???
  6. Just try... SELECT * FROM wp_usermeta WHERE user_id IN (SELECT user_id FROM wp_usermeta WHERE meta_value LIKE "%s2member_level%")
  7. It seems that you surprised Let's say you go to the cafe and say "give me a tea with sugar". You get a tea with sugar... But you ask "why do you put in sugar???". Correct answer - it's because you ask about it. If you need both rows you have to exclude the first condition.
  8. I'm very familiar with Erlang C formula (I'm programmer at GSM/3G operator). And I know 2 versions. Even if I know it it's difficult to understand your question. BTW use php tags instead of code tags. It will highlight PHP code About programming. You wrote $sigma_formula = ''; You'd better write $sigma_formula = 0; because you use it later in the mathematical equations.
  9. You have meta_key equals "wp_s2member_custom_fields" (your first condition) in the last line only but not in both lines! Why do you surprised? PS. scootstah is quite right when say "You should be splitting that data into separate table...". I'd add to it "...or into separate fields in one table".
  10. I bet you don't use function mysql_query() You statement is not a real statement. It's just a string now.
  11. This code if(isset($_GET['page']) $page=$_GET['page']; else $page=1; is better to write in another way $page= isset( $_GET['page'] ) ? $_GET['page'] : 1;
  12. First of all you need to save image by move_uploaded_file() and then, on success, save info into DB. I hope that you know the structure of your DB.
  13. What are you doing? 1. Save info from POST array. 2. Save loaded file but don't save info about this file into DB! 3. Don't let a user read info "The file has been uploaded as ".$ran2.$ext;
  14. Show you code. How do you insert these images. Otherwise it's impossible to say what is wrong. Maybe you use UPDATE instead of INSERT? Or, maybe, you set just one name for all images that you are load?
  15. Another question: what do you like to get? Do you like to have 2 images in the DB (and then maybe 3 and more) or something else?
  16. First of all write you query to the variable $query_str="SELECT * FROM banks WHERE submitter LIKE '$sub' or choosebank LIKE '$bank' or choosetype LIKE '$type' or $money_column LIKE '$money_column' or $money_value LIKE '$money_amount' or inputdate LIKE '$inputdate' or descript LIKE '$descript'"; // and then echo it echo $query_str.'<br>'; Then check what do you have in this query. Write it here.... We will check together. And show the exact error message from MySQL. And also, please, don't show your PHP code if the problem is inside MySQL query
  17. It seems that you need array_combine() http://ru.php.net/manual/en/function.array-combine.php Also you have to change your code, because if you use array_combine() you'd have one array as array's keys and another as it's values. As for array_merge... It works as expected But you don't need it here.
  18. This is just a function. 1. It checks if "magic quotes" are switched on. If NO, it add slashes to a $value. 2. If $value is not numeric function mysql_real_escape_string adds special characters. BTW I just name you functions from this script. You can do it by yourself if go to http://www.php.net/manual/en/ an enter funciton names. These actions are needed in order to prevent SQL injection.
  19. I still don't understand why you don't like to use strtotime()? It works fine and it doesn't matter if you have preceding zeros or not Check it, for example var_dump( strtotime( '2012-01-05' ) < strtotime( '2012-1-4' ) );
  20. 1. This code foreach($keywords as $key=>$keyword) { $where .= "`l_name` LIKE '%$keyword%'"; if($key != ($total - 1)){ $where .= "OR"; } could be changed to one string $where = implode( ' or ', $keywords ); 2. Why do you use here $results_num = ($results = mysql_query($results)) ? mysql_num_rows($results): 0 ; one variable $results for different aims? You'd better use 2 different variables. 3. Echo your request just when it's created. And show it here - maybe it's wrong? Also you may try to start it in phpmyadmin, it's possible that you really don't have rows in a table that a satisfy your request.
  21. You wrote a lot of PHP code, but start the name of your topic from word 'MySQL'. And where do you have a problem - in PHP or in MySQL query?
  22. Sorry... I didn't see your answer You may use, of course, strtotime() function. It converts string to UNIX time, in seconds. Then you may compare these times.
  23. Maybe I wrong about what you are going to do... But you can use JavaScript in order to change your links when user enter any info. Just create one or some function(s) and put call to it into 'onchange' of that element where your user enter his info.
  24. What is not clear? It's written about returned value, in the help Another question: did you try DateTime? http://ru.php.net/manual/en/book.datetime.php
×
×
  • 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.