mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
Good... so the answer was (and is) in Reply #3.
-
@fxuser: my fault... I read your post incorrectly try this UPDATE act SET `from` = IF (`to` = '$un_curr', '$new_un', `from`), `to` = IF (`from` = '$un_curr', '$new_un', `to`);
-
that is the whole output? and did you tried removing the enctype?
-
$query1 = mysql_query("UPDATE act SET `from`='$new_un', `to`='$new_un' WHERE `to`='$un_curr'"); notice also the usage of backtics for your fields "from" and "to"... both are MYSQL rserved words http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
-
what is the output of this? (placed before the mysql_query): echo file_get_contents("php://input"); also is out there few people reporting that removing enctype from the form fix data lost in $_POST (reason apparently is because the wrong enctype is used) .... no tested/proved in my side... maybe worth a try
-
if you have tested/debug your code already as you said and everything has not been changed on it to produce the behavior... then, this part in your post could point to that something was done in the server configuration: If the code WAS working before, and nothing on it has been changed and all the sudden started acting then maybe the answer is not in the code... " happened out of nowhere" is just no possible. Agree with what others said... post you whole relevant code, otherwise is very difficult to help... and also look for changes in your configuration.
-
mysql_query: http://php.net/manual/en/function.mysql-query.php mysqli_query: http://php.net/manual/en/mysqli.query.php different formats
-
if it is defined as you show then is not
-
in your php.ini look for the definition of date.timezone and define it as you need... example: date.timezone = 'America/New_York' alternative you can change it in your scripts: http://php.net/manual/en/function.date-default-timezone-set.php
-
maybe this can be of interest for you http://www.phplivedocx.org/articles/using-livedocx-without-the-zend-framework/
-
@jarvis: Don't worry... is not offense (or anything similar)at all... I'm just trying to push you to debug your code by yourself... that is the best way for you to learn. The problem is simple and you should have be able to catch it... your table name is wp_bp_groups_members and in the code that I gave to you: SELECT wp_bp_groups.name, GROUP_CONCAT( wp_bp_xprofile_data.value ORDER BY wp_bp_xprofile_data.field_id ) FROM (wp_bp_xprofile_data JOIN wb_bp_groups_members ON wp_bp_xprofile_data.user_id = wb_bp_groups_members.user_id) JOIN wp_bp_groups ON wp_bp_groups.id = wb_bp_groups_members.group_id GROUP BY wp_bp_groups.name; is named as wb_bp_groups_members you see the problem now?...
-
is a lot of examples here for that... just search the forum. the implementation is going to depend on your expertize, now for code generators... also a search in google will give you tons of alternatives. for grids for example here is an alternative (which again is going to depend in your knowledge level or time to learn) http://dev.sencha.com/deploy/dev/examples/
-
well... if you are seeing the message echoed in you else that is not an error.... your code is doing exactly what is supposedly to do... you have: if (mysqli_num_rows($data3) == 1) { // more code here } else { echo '<p class="error">There was a problem accessing your profile.</p>'; } which means that your mysqli_num_rows($data3) != 1, therefore your SELECT is returning more than 1 row or none.
-
"INNER JOIN tutor_level AS tl USING (sl.level_id) " . "INNER JOIN tutor_subject AS ts USING (sl.subject_id) use only the column name inside USING() don't use aliases. From the Manual: and last... too many " and . in your sql... you can write it like this: $query3 = "SELECT sl.level_id, sl.subject_id, tl.level_name AS level_name, ts.subject_name AS subject_name FROM tutor_overall_level_subject AS ols JOIN tutor_subject_level AS sl USING (subject_level_id) JOIN tutor_level AS tl USING (level_id) JOIN tutor_subject AS ts USING (subject_id) WHERE ols.tutor_id = '" . $_GET['tutor_id'] . "'";
-
A better redirect instead of header("")
mikosiko replied to President Obama's topic in PHP Coding Help
http://tinsology.net/2009/06/creating-a-secure-login-system-the-right-way/ Thats where I saw it. in the same article the author explain his point of view: -
@jarvis: This is the query that I gave to you: SELECT wp_bp_groups.name, GROUP_CONCAT( wp_bp_xprofile_data.value ORDER BY wp_bp_xprofile_data.field_id ) FROM (wp_bp_xprofile_data JOIN wb_bp_groups_members ON wp_bp_xprofile_data.user_id = wb_bp_groups_members.user_id) JOIN wp_bp_groups ON wp_bp_groups.id = wb_bp_groups_members.group_id GROUP BY wp_bp_groups.name; and your answer: Table 'xxx.wb_bp_groups_members' doesn't exist now.. tell me... where in the code that I gave to you is something like this xxx.wb_bp_groups_members ? and worst... what you did to find the problem and fix YOUR error? ... go back to your code and check it again.
-
? use switch http://php.net/manual/en/control-structures.switch.php
-
Find the largest value for each group and sum
mikosiko replied to Skipjackrick's topic in MySQL Help
I said: ... that you can use/adjust according to your needs. copy/paste alone is not going to give you immediate results.. is YOUR job to : - Test the code given to you first (using Phpmyadmin or whatever you use to run queries), and analyze if it is giving the results that you want, or adjust it properly. - Then you can adjust your code (php) to show the data produced by the correct query in the way that you want. ? is some leg work to do in your side my friend.... as a very well know comic say... "C'mon YOU can do it!!" -
Find the largest value for each group and sum
mikosiko replied to Skipjackrick's topic in MySQL Help
.. sorry to say this.... but you are wrong again ... for you to read: http://php.net/manual/en/function.mysql-fetch-array.php -
Find the largest value for each group and sum
mikosiko replied to Skipjackrick's topic in MySQL Help
I didn't read all your code... your query is wrong.... here is a small example (one way to solve your original questions) that you can use/adjust according to your needs. SELECT angler, SUM(mlenght) FROM ( SELECT angler, MAX(lenght) AS mlenght FROM anglers GROUP BY angler, specie ) AS zz group by angler; -
Find the largest value for each group and sum
mikosiko replied to Skipjackrick's topic in MySQL Help
37 is correct... seems that you didn't understand the OP's requirements Angler A largest catch for each species is: which is equal to 37. your query doesn't do the job.. @Skipjackrich : here is something for you to explore: http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/ -
that is the right code... if you are getting that error then you have a mistake in a different place... maybe spaces/special characters in the $name variable?... use it enclosed in ' EDIT: I just read that you figure it out... good
-
// Check for name duplicates and deal with $query = "SELECT * FROM pictures WHERE src = $name"; $result = mysql_query($query); if($result) $dup = true; while($dup) { ^^ seems like a wrong logic to me... try : // Check for name duplicates and deal with $query = "SELECT * FROM pictures WHERE src = $name"; $result = mysql_query($query); if(mysql_num_rows($result) > 0) $dup = true; while($dup) { From the manual regarding mysql_query():