- Strength to Increase Rep
- +12
- Strength to Decrease Rep
- -3
- Upvotes Received
- 155
- Posts with Upvotes
- 145
- Upvoting Members
- 78
- Downvotes Received
- 9
- Posts with Downvotes
- 8
- Downvoting Members
- 9
802 Posted Topics
Re: In my experience the fastest method would be: 1) Copy only the structure of the source to the target. 2) Dump the table contents to single CVS (TXT) files. 3) Load the text files with "Load data..." | |
Re: The $path is missing in the img tag in line 30. | |
Re: In my windows system it's in e:\Program Files\MySQL\MySQL Server 5.1\share\mysql_fix_privilege_tables.sql and on my linux system in /usr/bin/mysql_fix_privilege_tables | |
Re: You have one form in your HTML and then some input elements outside of the form. They are never sent. For me, the easiest way to transform POST data in a mail text is a post array walk: [ICODE]foreach( $_POST as $key => $value ) $message .= "$key: $value\n"; mail($to, … | |
Re: Maybe you could use an arbitrary sorting using the IDs. If the order of posts with the same date does not matter, increase the limit parameter and keep the date until there are no more posts for this date. SELECT * FROM $logbook WHERE Date>='$Date' AND ID!='$ID' ORDER BY Date, … | |
Re: Add "FIRST" after the column name. [url]http://dev.mysql.com/doc/refman/5.1/de/alter-table.html[/url] [CODE]ALTER TABLE mytable ADD COLUMN xyz(text) FIRST; [/CODE] | |
Re: You *can* export the system database (users, rights etc.) with `mysqldump mysql` and import it again, but this may lead to all sort of trouble. | |
Re: $pdf->Output() writes a PDF file. This cannot contain JavaScript. The browser will not understand your code. For passing variables between scripts use sessions and the $_SESSION array. | |
![]() | Re: phpMyAdmin has a dump option built in, and Navicat has, too. |
![]() | Re: [CODE]$f = fopen( 'filename.txt', 'a' ); fwrite( $f, 'something' ); fclose( $f ); [/CODE] |
Re: Did you have any difficulties with your method? If it's not broken, don't fix it. What is "this variable"? What are you doing now in your script? Are you working with sessions or with redirects or with cookies? | |
Re: If you have an account on the server, you can use cronjobs which regularly trigger actions. I recommend that you set up a PHP script which does whatever bookkeeping you need, and that you call it either directly with php <myscript.php> or via the apache server using wget http://<myserver>/<myscript.php> If … | |
Re: You need brackets around your OR clause and no apostrophes around column names: SELECT * FROM stats WHERE (ip LIKE '%192.168.0.1%' OR ip LIKE '%192.168.1.2%') AND topic!='' AND cat!='' | |
Re: If you want to learn MySQL, forget PHP. Look for a MySQL or plain SQL tutorial which does not use PHP and learn the SQL basics using the command line tool `mysql`. | |
Re: Show the output of your SHOW CREATE TABLE statement and the piece of code where you try to insert something. | |
Re: Learn about aggregate functions like AVG and SUM and about the GROUP BY clause in SELECTs. | |
Re: select distinct a.mem_id, (select count(b.ref_id) from ref_track b where b.mem_id=a.mem_id) as cnt from ref_track a order by mem_id The downside is that the aggregate function is called for each row of ref_track. | |
Re: You have to join the two tables: select * from publication p, publication_issue i where i.publication_id = p.id and p.tags like '%news' order by something limit x,y | |
Re: The varchar field should have at least 2.000 characters. URLs can be that long. See http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url | |
Re: 2) is not really a MySQL question. You have to study the login and authorization mechanisms of phpBB and MediaWiki and tweak them so that they point to a common user base. This is exactly what a plugin already does: http://www.mediawiki.org/wiki/Extension:Phpbb_Single_Sign-On | |
Re: Have a look at mysql events. http://dev.mysql.com/doc/refman/5.1/en/events.html | |
Re: Your form variable is named `class_ID`, but the mysql column name is `class_name`. Looks fishy to me. | |
Re: Probably your forgot to change the delimiter before and after your procedure definition: DELIMITER // CREATE PROCEDURE LoginCorrecto ... ... END // DELIMITER ; | |
Re: From your mysql console, run show variables like "%dir%"; The result will contain a variable named `datadir` which contains the path where you should look for data files. | |
Re: Show the content of $result before the error occurs. | |
Re: You're trying to get a partial tree as a result. In this setup, you will need a (recursive) (user defined) function which walks all the way up from wtshirt to dress. | |
![]() | Re: Along those lines: select * from tableA where b = 'y' or ((not exists (select * from tableA where b = 'y')) and a = 'x') or ((not exists (select * from tableA where a = 'x' or b = 'y'))) |
Re: Your 2nd query is correct. If it does not return data, then the data are wrong. Show a sample. And how is "Anna" *before* "Ann" in your table? You don't have any ORDER BY clause in your query, so the word "before" makes no sense here. | |
Re: If it runs in another interface but not in your code, then your error is in how the query is built in PHP. Debug it. Show us which query actually is posed to the server. What does the string "SELECT GROUP_CONCAT(IF((@var_ctr := @var_ctr + 1) = @cnt, location, SUBSTRING_INDEX(location,' - … | |
Re: http://lmgtfy.com?q=mysql+number+of+indexes http://dev.mysql.com/doc/refman/5.5/en/column-indexes.html > The maximum number of indexes per table and the maximum index length is defined per storage engine. See Chapter 14, Storage Engines. All storage engines support at least 16 indexes per table and a total index length of at least 256 bytes. Most storage engines have higher … | |
Re: Use the command line tool mysqldump to dump the whole database to a file which you can then store at a safe place. | |
Re: I don't know of any MySQL string function which would cut any strings from the `","` up to the next `"-"`. MySQL does not offer regular expression functions which might do the trick. You can write a user defined function, though, which cuts those parts and apply it to the … | |
Re: select id, lecture, Table1.subject_id, date, c, (select count(subject_id) from Table1 as t where t.subject_id = Table1.subject_id and t.date <= Table1.date and is_deleted != 1 ) as flow_id from Table1 inner join ( select subject_id, count(subject_id) as c from Table1 where is_deleted != 1 group by subject_id ) as counts on … | |
Re: Put them behind a firewall on an encrypted drive. Let no one access the server except your application (using MySQL grants). If you need access from outside, do it over VPN. And there are tons of other security measures which you may find here: http://lmgtfy.com/?q=mysql+security | |
Re: Have a look at MySQL events which allow you to run code at a certain time. http://dev.mysql.com/doc/refman/5.1/en/events-overview.html | |
Re: You can, if you assign the variables first. And for readablity I think it's easier to integrate the variables in the string (at least if you're using a decent PHP editor with syntax highlighting). [CODE]$name = $result['name']; $bio = $result['bio']; Print "<tr><td class='ParaText' align='left' valign='top'>name</td><td class='ParaText'>$name</td><td class='ParaText' align='left' valign='top'>$bio</td></tr>"; [/CODE] | |
Re: Show the table structure. Show the result of EXPLAIN <your query>. Do you have an index on the price and on the oen_norm field? Effectively you are grouping on oen_norm, take the minimum price of each group and filter all entries with that minimum price and a quality of 1, … | |
Re: Your query contains the string "'". The backslash is not recognized as an escape character by MySQL. Get rid of it. Where does it get into your code? | |
Re: Obviously you are feeding some text from a variable into a MySQL statement which contains an apostrophe (') which is not escaped. | |
Re: UPDATE alters all records to which the condition applies. It does not matter if it applies only to one, to several, to none or to all records. For multiple conditions add them to the WHERE clause with the boolean operators AND, NOT and OR, like in UPDATE userTable SET status … | |
Re: Your second clause is redundant. In effect your query reads: select * from customers where id in (...) This can select at most one customer per id. Instead use: SELECT * FROM customer INNER JOIN address ON customer.ID = address.customer_ID INNER JOIN sites ON address.ID = sites.address_ID WHERE upper(customer.$field) LIKE'%$query%' | |
Re: Check for slow queries. (Look up how to enable the slow query log in my.cnf). Check if you can optimize the slowest. Also have a look at the process list while mysql is running under high load. (`show processlist` from the mysql command line). Which processes are open? Just waiting … | |
Re: Try the offending query from the mysql command line. Check how long it runs on the online machine and on the local server. Also the error message suggests that this is not a mysql error or timeout but a timeout of your client component. Try to increase the timeout for … | |
Re: This is a network connectivity problem. Might be that the mysql server on stoberwebcom.ipagemysql.com has to high load to response. That can happen on shared servers by other users and other applications than yours. | |
Re: Your post is not clear. Which error occurs when? To get a synchronous insert and update behaviour, use transactions to bracket all statements. |
The End.