mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
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
-
show your tables and queries for better answer... UNION can be used if all the rules are followed.
-
Help Assigning Query Rows to Different Variables
mikosiko replied to dmhall0's topic in PHP Coding Help
post your relevant code to get more help -
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
-
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).
-
and the warnings are?
-
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 . "' ";
-
try: $query = "SELECT * FROM table_user WHERE shoppingbox NOT REGEXP '\[\[:<:]]$boxitem\[\[:>:]]'";
-
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.
-
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
-
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()
-
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
-
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
-
Server/PHP config so you don't have to use $_POST['var']
mikosiko replied to Zephni's topic in PHP Coding Help
register_globals http://php.net/manual/en/security.globals.php -
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.
-
@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
-
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
-
<? while( $cours = mysql_fetch_array($result) ){ $row++; ?> replace the short tags for the long ones <php? while( $cours = mysql_fetch_array($result) ){ $row++; ?>
-
Find the second hieghest value in a table
mikosiko replied to son.of.the.morning's topic in MySQL Help
ORDER BY DESC ... and LIMIT using offset LIMIT format: LIMIT {[offset,] row_count -
so maybe we should "stick" you in the front page
-
for your code sure Pikachu2000 means to say mysql_error() instead of mysqli_error()
-
MYSQL Update followed by Select query not working
mikosiko replied to jumpinjacq's topic in PHP Coding Help
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'] ...