mikosiko
Members-
Posts
1,327 -
Joined
-
Last visited
-
Days Won
1
Everything posted by mikosiko
-
without seen your code seems unnecessary to me... you only have to implement a good error control and proceed accordingly if you detect any error. in any case here are examples of multi query usages http://php.net/manual/en/mysqli.multi-query.php and yes you can continue using prepared statements
-
review your code define if you are going to use the $quotes array or since that you are extracting the row fields use the "quote field" (don't know the field name) directly
-
I don't see where are you populating your $quotes array
-
what about.... "post your code" idea ? around here everyone rate is double if we have to use the "crystal ball" j/k
-
test first with a SELECT instead of DELETE to be sure it works ok (it should) SELECT * FROM table WHERE NOT name REGEXP '[a-z]';
-
LOAD DATA INFILE will be my choice http://dev.mysql.com/doc/refman/5.1/en/load-data.html table without indexes improve even more the load performance
-
the first rule to follow: - TEST the query before to use it in PHP.... I did and is working you error was that you removed the CAST() function but you did it wrongly .... this sentence SELECT GROUP_CONCAT(system_disk_qty AS CHAR) AS system_disk_qty, GROUP_CONCAT(system_disk_size AS CHAR) AS system_disk_size FROM system_disks WHERE system_id = 2 GROUP BY system_id; should be SELECT GROUP_CONCAT(system_disk_qty) AS system_disk_qty, GROUP_CONCAT(system_disk_size) AS system_disk_size FROM system_disks WHERE system_id = 2 GROUP BY system_id; and are you sure that the field system_disk_qty IS NOT A NUMBER? ... if it IS a number you have to use CAST()
-
you are no explaining why do you think is not working....
-
another option.. (replace the field name for the correct ones) SELECT GROUP_CONCAT(CAST(diskqty AS CHAR)) AS diskqty, GROUP_CONCAT(diskmake) AS diskmake, GROUP_CONCAT(diskmodel) AS diskmodel, GROUP_CONCAT(CAST(disksize AS CHAR)) AS disksize, GROUP_CONCAT(CAST(disksrno AS CHAR)) AS disksrno FROM system_disks WHERE system_id = 'aNumber' GROUP BY system_id Notes: - the usage of CAST() is assuming that those fields are numerics... otherwise just remove it - if you don't want to repeat identical values like p.e: diskmodel change that line to: GROUP_CONCAT(DISTINCT diskmodel) AS diskmodel, - and last... be careful with the group_concat_max_len system variable which has a default of 1024
-
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost' (10061)
mikosiko replied to R_14_14's topic in MySQL Help
I was not referring to mysql.err I said mysql .err file (there is an space there )... normally the .err file is named <your computer name>.err and is located under your mysql data directory. I did check your phpinfo() output and effectively mysql and mysqli are enabled... also I did notice that you have a 64b machine (AMD64)... did you installed the 64b mysql version or the 32b version?.... that could be a probably cause or your errors, other than that I have read several other users reporting the same error and pointing to a faulty mysql installation ... and re-install it from scratch has solved the issue... you can try checking the mysql version first (32 or 63b) and if that doesn't work maybe a re-install will help hope this help -
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost' (10061)
mikosiko replied to R_14_14's topic in MySQL Help
run this and look if it shows MYSQL information <?php phpinfo(); ?> if you don't find an entry for MYSQL check your php.ini to see if the mysql extension is enabled or not... also check if effectively MYSQL is listen in port 3306 (look your mysql ini file)... also look for your mysql .err file and look what it say... and another idea... if you have a firewall look if the port 3306 is allowed -
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost' (10061)
mikosiko replied to R_14_14's topic in MySQL Help
have you tried to start the service?... what happens if you do? -
Is that difficult to understand what Gizmola asked for ? either the code that you posted is incomplete or you are using $_GET in the wrong way.... if your code is incomplete... post it again
-
and with an UPDATE clause :-\
-
I don't know what you tried to do... but you really screw up your original code... now you have some lines that doesn't make sense at all.. like - the first exit() ... delete that - this 2 lines... out of place and with no sense $str = strip_tags($str); return mysql_real_escape_string($str); - like this lines... with and unclosed { and a variable $errmsg_arr hanging there alone ??? if($errflag) { $_SESSION['ERRMSG_ARR'] = $errmsg_arr; session_write_close(); $errmsg_arr - this lines are wrong too ... $result is being used before it is declared/populated by your query... ?? if($result) { $result=mysql_query($qry); echo $result; exit(); }else { die("Query failed"); } better to go to the draw board and think a little better your code again.... look for some examples -
-
post your actual and complete code again...
-
How to email without the broken function email()?
mikosiko replied to Krisando's topic in PHP Coding Help
SwiftMailer http://www.swiftmailer.org/ read the documentation and try -
did you run phpinfo() to check that Mysql is enabled? look if you have extension=php_mysql.dll enabled in your php.ini and also be sure that extension exist in your extension_dir. and finally add this lines to you php script to see what error it is sending error_reporting(E_ALL); ini_set("display_errors", 1);
-
because your select is doing a couple of JOINS without conditions ... this part has an incorrect format that cause the behavior that you are seeing FROM ".DB_PREFIX."topics JOIN ".DB_PREFIX."members JOIN ".DB_PREFIX."parents JOIN ".DB_PREFIX."forums ON ".DB_PREFIX."topics.topic_poster = ".DB_PREFIX."members.user_username it should be something like this (adjust to your table descriptions) FROM ".DB_PREFIX."topics JOIN ".DB_PREFIX."members ON ".DB_PREFIX."topics.topic_poster = ".DB_PREFIX."members.user_username JOIN ".DB_PREFIX."parents ON ".DB_PREFIX."<complete here> = ".DB_PREFIX."<complete here> JOIN ".DB_PREFIX."forums ON ".DB_PREFIX."<complete here> = ".DB_PREFIX."<complete here>
-
you know... at least you should try to understand and do some basic... basic... really basic intent to make it work and no just cut & paste.... $query = "SELECT * FROM people WHERE FirstName LIKE \"%$trimmed%\" ORDER BY FirstName"; was a missing ; at the end... was not THAT simple?
-
:'( :'( :'( ..... just kidding... try this $query = "SELECT * FROM people WHERE FirstName LIKE \"%$trimmed%\" ORDER BY FirstName"
-
and %'s are no screaming LIKE ?
-
check the usage of ' and " in your $query clause...