Jump to content

mikosiko

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mikosiko

  1. and for what reason you can't do the 3 queries in just one sentence?... there is a clear relationship among them.. you could get all the data that you need with 1 query and process/display it at you wish. if that is not the route that you want to follow (??) then yes.. you can use UNION to mix data from queries 2 and 3
  2. show your tables and queries for better answer... UNION can be used if all the rules are followed.
  3. post your relevant code to get more help
  4. you are the only one that could know how your transaction id field is called... either way.. assuming (for you to check) that your field name is nSTId you can assign it value to some variable here: $this_user = $srow['nUserId']; $other_user = $srow['nUserReturnId']; $transactionId = $row['nSTId']; and use $transactionId in the rest of your code
  5. make perfect sense to me... you are LEFT joining the calendar table with the reviews table, therefore if in any week there are no records in the table reviews your reviewee_id field is going to be NULL, hence the JOIN with the employees table will produce as result the employee name with NULL value. In your scenario the only way that your select is going to work and give the result that you are expecting is if for each week and for each employee there are at least 1 record in the table reviews with the field rating_id NULL, ZERO or any other value non-existent in the table ratings. The other probable solution is get only the data available with the SELECT, and post-process at display time (using some array and some logic to fill the missing records for a week).
  6. and the warnings are?
  7. where in your SELECT are you getting the nTransactionId column (assuming that the column exists in your table users)? $sql = "SELECT vLoginName,vFirstName,vLastName,vAddress1,vAddress2,vCity,vState, vCountry,nZip,vPhone,vFax,vEmail FROM " . TABLEPREFIX . "users U where nUserId='" . $this_user . "' ";
  8. try: $query = "SELECT * FROM table_user WHERE shoppingbox NOT REGEXP '\[\[:<:]]$boxitem\[\[:>:]]'";
  9. no idea which are your lines 13 - 14... post your updated code first .... but kitchen already show you how to incorporate the dotted separation, however, and just a comment for now ... here is what you defined as your goals: Which is your criteria to define which ones are the 3 most used among the 150 or more records in your table?... you need to have a mechanism to separate those 3 from the rest (because the rest need to be ordered alphabetical as you said).... think about that for now.
  10. No, it differs because you are using the basic mysqli sentences incorrectly... let me help you pointing out the errors using the last post of the thread that you used as an example (no matter if that example is ok or not for your objectives) Example code from the referred link... comments added... It is using OOP Style in the whole script <? $mysqli = new mysqli('localhost','root','newr00t'); // Can you see how this line differs from yours? $mysqli->select_db('orders'); $result = $mysqli->query("SELECT * FROM user"); // This is how he execute the query... compare this line with yours echo "<SELECT name='user'>\n"; while($row = $result->fetch_assoc()) { echo "<option value='{$row['userid']}'>{$row['name']}</option>\n"; } echo "</select>\n"; $result->close(); // This is how the result set is closed.... compare it with your closing line ?> hope this little comparison help you with your code
  11. read the examples in the link that I did provide.... and by the way... the link that you are referring to has also examples that differ from what you wrote in your code
  12. is that your real code? ... asking because I see some intent to use mysqli OOP style coding mixed with Procedural style... mixing like that is not going to work. here http://php.net/manual/en/mysqli.query.php you can see clear examples of both styles in your code are wrongly used... - mysqli_connect - $mysqli_query - $result->fetch_assoc() - $result_close()
  13. what have you tried already ? ... PHP has a lot of options, and MYSQl as well http://www.php.net/manual/en/function.strtotime.php http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
  14. this line: $imagejpeg($image); should be: imagejpeg($image);
  15. I don't see any echo in the code that you posted (except your echo "error") that could produce your "gibberish", but I could bet that you are trying to echo an image file... post your relevant code
  16. register_globals http://php.net/manual/en/security.globals.php
  17. Normally the error could be caused for: a) The Foreign Key recipient table doesn't have a INDEX on the referenced column. b) Some of the FK column or the referenced column Flags are different... common case UNSIGNED/SIGNED, BINARY/NON BINARY, or (most common case) b) The data type between the FK column and the referenced column are different.
  18. @kleb: why you are duplicating your content in the tables topics and post? ... no make any sense... seems to me that you have a big confusion between the answers to your previous post where Drongo was helping you, and the ones here. Just to refresh the goals that you explain in your original post
  19. For a start in your code you are not defining what is $time2, secondly if your tables `2010_picks` and `2012_tournaments` are in some way related (the field ID maybe ?) then you don't need those 2 SELECT in your code and those nasty loops, for that case you just need a JOIN between the tables and compare your start_date_time as kichen suggested
  20. <? while( $cours = mysql_fetch_array($result) ){ $row++; ?> replace the short tags for the long ones <php? while( $cours = mysql_fetch_array($result) ){ $row++; ?>
  21. self-join
  22. ORDER BY DESC ... and LIMIT using offset LIMIT format: LIMIT {[offset,] row_count
  23. so maybe we should "stick" you in the front page
  24. for your code sure Pikachu2000 means to say mysql_error() instead of mysqli_error()
  25. echo you raw query to check if the UPDATE is what you are expecting. $query = "UPDATE membertable SET $taskvalue = 'done' WHERE id = $memberid"; echo "Query : " . $query; // and check if sentence is valid $result = mysqli_query($dbc, $query); I also noticed that in the 3 forms you are using $_SESSION['task1'] ...
×
×
  • 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.