mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
will be interesting to see first the complete definition of the table from where you are selecting the data, or even maybe your DB already has a table to associate the state number with the name, and you just need to modify your select with the proper JOIN; otherwise Barand solution. [Edit:] Psycho beats me.
-
maybe is this what you are looking for: for ($i=0.0;$i<24;$i+=0.25){ $hour = floor($i); $min = sprintf("%02s",round(60*($i-$hour))); echo $hour . ':' . $min .'<br>'; }
-
missing FROM. but most likely you don't need the subquery.. you can JOIN the table item_detail twice using a different alias (Jesi just gave you that solution), or you just can add the condition b.itemID = a.user_item to your existing JOIN, which one to use is not clear reading your objectives.. : Joining twice SELECT b.price as totalPrice , b.track_item_id , a.user_item , c.price as myprice from tracked_item as a left join item_detail as b on b.track_item_id = a.id left join item_detail as c on c.itemID = a.user_item WHERE itemStatus='Active' AND b.user_id='$uid' Adding a condition to the actual JOIN SELECT b.price as totalPrice , b.track_item_id , a.user_item , b.price as myprice from tracked_item as a left join item_detail as b on b.track_item_id = a.id AND b.itemID = a.user_item WHERE itemStatus='Active' AND b.user_id='$uid' GROUP BY b.track_item_id
-
I do agree that the parenthesis doesn't make the difference (after the missing one was corrected), for me is just a matter of code style... what most likely is causing the T_IF error is the tag... assuming it IS IN the code as shown, and also assuming that the posted code is the whole code... otherwise the OP need to look for unmatched delimiters or missing closing semi-colons before the line that containing the if throwing the error
-
you didn't have to REMOVE one... you have to ADD one at the end. this is part of the code that you posted (see comments) [email] /// IS THIS TAG PART OF YOUR CODE OR JUST GARBAGE?... IF IT IS IN YOUR CODE REMOVE IT AND ALSO THE CLOSING TAG DOWN BELOW if((isset($_POST['status']) && ($_POST['status']) == 'Active') /// DON"T REMOVE a parenthesis ADD one ) by the end {
-
count the open and closed parentheses in this line, and you should be able to figure out why are you getting the error if((isset($_POST['status']) && ($_POST['status']) == 'Active') {
-
Congrats Goddess.
-
show us the EXPLAIN PLAN, what INDEXES you person_booking and booking tables have?... most likely you need to have indexes on the fields BookingCode of your table Bookings and in the fields PersonCode and BookingCode in your table PersonBooking... (it is named PersonBooking or person_booking?)... in an additional observations: - is there any reason for you to use an ID field in your table Booking?... is not enough to use just the BookingCode as PK? - the ID field on the table PersonBooking could be dropped too
-
Having an issue with UPDATING SQL Database via PHP Table
mikosiko replied to mbb87's topic in PHP Coding Help
in addition to all the good pointers already given I'm still seeing the table enclosed in single quotes instead of backtics (or nothing) $query = "UPDATE 'players' SET `block` = $block WHERE `players`.`pl_id` IN ({$checked_players_list})"; -
Please help duplicating rows from MSQL vi PHP.
mikosiko replied to brucegregory's topic in PHP Coding Help
I don't see the problem... "he" is going to decide which items "he" want, either before the duplication or after... I will duplicate everything and allow the user to eliminate/add/modify items after the duplication -
maybe there is were your problem start.... you don't have "to find".... you have to learn how to write a simple JOIN here http://dev.mysql.com/doc/refman/5.0/en/join.html you're going to find how must be done with several examples... just write code and try... if still having problems post the code that you have tried and ask specific doubts.
-
help creating a mysql table for random data retrival
mikosiko replied to Bill Withers's topic in MySQL Help
between this 2 lines: $result = mysql_query($query); $course= $row ['course_name']; you must to use some of the mysql_fetch_....() functions to .. well... fetch your data and give some content/meaning to $row mysql_fetch_assoc() per example http://php.net/manual/en/function.mysql-fetch-assoc.php -
I don't see a problem here... you just posted an example of using a SELECT with a JOIN between 2 tables... just follow your own code as an example and try to modify it according to what you want now
-
Which MySQL, like MySQLI, etc., is best with PHP 5.38 or >?
mikosiko replied to yshua's topic in MySQL Help
- is your mysqli extension available?... in your PHP folder look in the sub-folder "ext" to be sure. - if present... it is enabled in your php.ini ? -
Query work with localhost and not work in live server
mikosiko replied to thara's topic in MySQL Help
your live server is running with the sql mode 'ONLY_FULL_GROUP_BY' enabled... probably running in ANSI mode if the mysql version is before 5.0.3 the error means that you are using an aggregate function (GROUP_CONCAT()) without a GROUP BY clause. more to read here: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html and here: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html -
that is not what she wanted to do... read the OP again
-
for a one time shoot you can try this alternative.... tricky but seems to do the job CREATE TEMPORARY TABLE xx (SELECT tbl.id FROM tbl JOIN (SELECT id,name FROM tbl GROUP BY name HAVING count(id) > 1) AS X ON tbl.id != X.id AND tbl.name = X.name); DELETE FROM tbl WHERE id IN (select id from xx);
-
here you go VHOSTS
-
just counting the single quotes should tell you one of the problems... looking the dots, the other
-
before anything.... post the EXPLAIN plan for each query
-
from the manual: mysqli_query() and the error message that you are getting just confirm exactly that mysqli_num_rows() most likely you want to use mysqli_affected_rows() http://www.php.net/manual/en/mysqli.affected-rows.php
-
PHP mySQL: Select with multiple criteria load a lot of row with LIMIT 12
mikosiko replied to pascal_22's topic in MySQL Help
this 2 links should help you to find the answer for yourself (both include examples almost identical to your case) http://webmonkeyuk.wordpress.com/2010/09/27/what-makes-a-good-mysql-index-part-2-cardinality/ http://www.mysqlperformanceblog.com/2006/06/02/indexes-in-mysql/ is those don't clarify it for you google: index cardinality, and index selectivity -
both topics were removed by an Admin... one was duplicated of this one and the other no idea why... anyways complementing PfmAbismad answer $dibby = mysql_pconnect($hostname_cicpriva_reg, $username_cicpriva_reg, $password_cicpriva_reg) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_cicpriva_reg, $cicpriva_reg); $dibby <> $cicpriva_reg and my answer for your second post regarding to your other mysql error for your insert was: the usage of pathname delimiters ('/' and '\') are not allowed in column names...
-
related and complementary answers here http://forums.phpfreaks.com/index.php?topic=362403.0 and http://forums.phpfreaks.com/index.php?topic=362402.0