rch1231 169 Posting Shark

The effective maximum table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits. The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive. For the most up-to-date information, be sure to check the documentation specific to your operating system.

Operating System 	File-size Limit
Win32 w/ FAT/FAT32 	         2GB/4GB
Win32 w/ NTFS 	                 2TB (possibly larger)
Linux 2.2-Intel 32-bit 	         2GB (LFS: 4GB)
Linux 2.4+ (using ext3 filesystem) 4TB
Solaris 9/10 	                 16TB
MacOS X w/ HFS+ 	         2TB
NetWare w/NSS file system 	 8TB

Windows users, please note that FAT and VFAT (FAT32) are not considered suitable for production use with MySQL. Use NTFS instead.

Found by googleing "mysql dev maximum database size" which returned
http://dev.mysql.com/doc/refman/5.0/en/full-table.html

rch1231 169 Posting Shark

Just in case this helps. If it is an PATA (IDE with 40 pin ribbon cable vs SATA) check to see if the cable is upside down on one end. Normally the cable is keyed but you find some that are not. Pin one (the one with the red stripe) should be closest to the power connection and check pin one on the mother board. I have seen several times where systems would not boot with upside down cables.

rch1231 169 Posting Shark

Normally you cannot connect two computers directly with a standard ethernet cable. You have to have a hub or switch involved to swap the send and receive wires to the right outputs. There are crossed cables available that will do the pin swapping for you but you are better off with a small hub. A standard cable pin one goes straight through to pin one and two to two etc. A crossed cable swaps pin one to pin two, two to one, three to four four to three, etc. so transmit on one computer goes to receive on the other and visa versa. Hubs and switches handle that for you. Some of the newer network adapters are designed to auto detect the cable configuration and allow you to connect without a cross connect cable but the older VIA adapters are not on the list. I bet you are not getting a link light on the network port when they don't connect. And when you get one on the new computer it takes a second to come on instead of the moment you plug it in.

rch1231 169 Posting Shark

I have seen this before. Create a file called unhookexe.inf with notepad or another simple text editor, on another system and put the following in the file:

Version]
Signature="$Chicago$"
Provider=Symantec

[DefaultInstall]
AddReg=UnhookRegKey

[UnhookRegKey]
HKLM, Software\CLASSES\batfile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\comfile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\exefile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\piffile\shell\open\command,,,"""%1"" %*"
HKLM, Software\CLASSES\regfile\shell\open\command,,,"regedit.exe "%1""
HKLM, Software\CLASSES\scrfile\shell\open\command,,,"""%1"" %*"
HKCU, Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,0x00000020,0

Put the file on a usb drive or copy it to the hard drive. Right click the file and select install and you will then be able to run exe files again.

rch1231 169 Posting Shark

Try using either float or decimal as the data type and you will be able to see the values stored with the decimal correct number of places.

rch1231 169 Posting Shark

Any time. Don't forget to mark the thread solved.

rch1231 169 Posting Shark

Hello,

To make the searches faster index the field. If possible use a unique index provided none of your descriptions are exactly the same. As far as limits on the size it depends on the version of MySQL.

From my reference manual.

CHAR(n)    character string with specified length, maximum 255 characters
VARCHAR(n) character string with variable length, maximum 255 characters (MySQL
           through 4.1: n<256; MySQL from 5.0.3: n<65,535)
TINYTEXT   character string with variable length, maximum 255 bytes 
TEXT           character string with variable length, maximum (2 to the 16 power)-1 characters
MEDIUMTEXT     character string with variable length, maximum (2 to the 24 power)-1 characters
LONGTEXT           character string with variable length, maximum (2 to the 32 power)-1 characters

New Aspects of VARCHAR: In MySQL 5.0 there are two significant innovations for the data type VARCHAR.
• The maximal column size for tables is now 65,535 bytes (it was previously
255 bytes). The maximum number of characters depends on the character set, since
many character sets require more than 1 byte per character.
• Spaces at the beginning and end of VARCHAR values are now stored in the table. Thus
INSERT INTO table (varcharcolumn) VALUES (‘ abc ’) actually stores ‘ abc ’ in the col-
umn, that is, a space, the characters a, b, and c, and finally another space character.
(Previously, MySQL deleted spaces at the end of VARCHAR values, which was in viola-
tion of the ANSI standard.)

rch1231 169 Posting Shark

Opps...You will need to sum each of the numbers and group by Category to get just one line.

Select 'Totals' As Category,sum(a) as 'Revenue', sum(Expenses), sum(a - Expenses) as ProfitLoss

.
.
.
Group By Category

rch1231 169 Posting Shark

Do you have the field "bulbID" set as not null in your table definition?

rch1231 169 Posting Shark

Take a look at the httpd logs and see what they show.

rch1231 169 Posting Shark

I think you are trying to get it all on one line with a column showing revenue - costs. If that is correct then add a column to the revenue entry like this:

SELECT 'Reveneue' AS Category,ROUND(Amount) as a, 0 AS Expenses FROM `Revenue`

and then change the total select line from the other selects to:

select 'Total' As category,sum(category_total) AS Expenses, 0 as a from

and finally at the very first select:

Select 'Totals' As Category,a as 'Revenue', Expenses, (a - Expenses) as ProfitLoss

should give you something like this

Category Revenue Expenses ProfitLoss
Totals 1000000.00 24.95 999975.05

By adding a column even if it is 0 to each of the unions you keep the number of columns and column names the same. IF I guessed wrong tell me what you want as the result and I will give it a shot.

rch1231 169 Posting Shark

I think I see what the problem is. When you use UNION you have to have the same column names in every query. On line 6 instead of

as Category_Total

you have

as expense

. I am not sure but I also noticed on the same line category is spelled with a lower case C and every where else it is capitalized. See if that fixes it and let me know.

rch1231 169 Posting Shark

Formatting Dates and Times

DATE_FORMAT(date, format) and TIME_FORMAT assist in the representation of dates and times in formats other than the MySQL default format. Three examples illustrate the syntax:

SELECT DATE_FORMAT('2005-12-31', '%M %d %Y')
December 31 2005

SELECT DATE_FORMAT('2005-12-31', '%D of %M')
31st of December

SELECT TIME_FORMAT('02:17', '%H')
02

rch1231 169 Posting Shark

Hello,

This is what I used for reference and it says INT UNSIGNED (4 bytes) which is how mine are defined and they work great.

MySQL has two built-in functions: INET_ATON() and INET_NTOA(). They are actually based on the equivalent inet_aton() and inet_ntoa() which are C library functions present on pretty much every TCP/IP capable system. Why? These two functions are used allover the place in any TCP/IP stack implementation or even application.
The INET_ATON() function converts Internet addresses from the numbers-and-dots notation into a 32-bit unsigned integer, and INET_NTOA() does the opposite. Isn't that handy!

Let's put it to the test:

mysql> SELECT INET_ATON('192.168.0.10') AS ipn;
+------------+
| ipn |
+------------+
| 3232235530 |
+------------+

mysql> SELECT INET_NTOA(3232235530) AS ipa;
+--------------+
| ipa |
+--------------+
| 192.168.0.10 |
+--------------+

So you can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15). Naturally, you can call the function while you're inserting, so something like this is fine also:

INSERT INTO tbl VALUES (..., INET_ATON('192.168.0.10'), ...)

cereal commented: great post +3
rch1231 169 Posting Shark

Hello,

If your output has the same number of fields with the same field names you can use UNION between the queries to generate a combined format and then sum it. Here is what merging the first two queries would look like. You will probably have to do a little tweaking but I think you will get the idea. From experience, get the first two working before you add the others. I usually get each query generating the output I want then merge them one at a time.

$result = mysql_query(
(
SELECT 'Diesel' as Category, FORMAT(ROUND( Qty * Itemrate ),2) as Category_Total
from `diesel_info`
INNER JOIN rates ON diesel_info.marker = rates.item
AND MONTH( diesel_info.Date ) = MONTH(rates.Date )
WHERE diesel_info.Code =$a AND MONTH( diesel_info.Date )=$m 
)
UNION
(
SELECT 'Lims Payment' as Category, FORMAT(ROUND(SUM(`Amount`/12)),2) as Category_Total 
FROM  `lims_payment` 
WHERE  `Code` =$a AND YEAR(DurationS)=$y
)
)
$row = mysql_fetch_array($result);
echo $row[0];
rch1231 169 Posting Shark

You could use a sub-queries to generate the main query. My example is kind of an odd way to accomplish this but it should work.

Basically to get this working you run a selection to generate a list of the db_emails that have more than one record. Strip out just the db_email field and use it to go back through the table selecting the records where the email address is in the list.

First get the two main queries working.

Query 1: What do I want the output to look like

select db_email, db_medlem 
from kunder 
order by db_email

Query 2: Create a select to output db_email and count where count > 1

SELECT db_email, count(*) 
FROM kunder 
GROUP BY db_email 
HAVING count(*) > 1

Refine Query 2 to just give you the db_email field.

SELECT data1.db_email from ((SELECT db_email, count(*) 
FROM kunder 
GROUP BY db_email 
HAVING count(*) > 1) as data1)

Plug Query 2 into query1 as a list to select from.

select db_email, db_medlem 
from kunder 
where db_email in 
(SELECT data1.db_email from ((SELECT db_email, count(*) 
FROM kunder 
GROUP BY db_email 
HAVING count(*) > 1) as data1)
)
order by db_email

That is as close as I can get without the actual db to play with so you may have to do a little tweaking. I may be off with one of the () around data1. If you want send me the results or errors and I will debug it for you.

rch1231 169 Posting Shark

Hello,

Assuming you want all fields returned.

SELECT * FROM table
where type_of_vehicle = 'A' or type_of_vehicle = 'B'

SELECT * FROM table
where type_of_vehicle = 'A' or type_of_vehicle = 'M'

SELECT * FROM table
where type_of_vehicle IN ( 'A', 'B', 'M')

rch1231 169 Posting Shark

You can use:
mysqladmin flush-hosts
That command drops dead connections.

rch1231 169 Posting Shark

You can use regedit and search the keys for the dll but personally I hate making changes to the registry. Download Malwarebytes and run it. It should find the entries and give you the options to remove them.

http://www.malwarebytes.org/

rch1231 169 Posting Shark

I understand and again I suggest gallery2 It is easy to install and the basic setup will do what you want. Should you choose to make it more complex in the future the options are there. You unpack the package and a basic setup takes about 1 minute and you can start posting images. No compiling, no configuration other than having a database in mysql for it to use, which it creates for you. Check out CNET for suggestions on different packages for different operations.

rch1231 169 Posting Shark

I may be missing something but where is $count assigned a value?

rch1231 169 Posting Shark

VMware is based on a Linux Kernel and really easy to use if you just do a little reading first. As for licensing you can get a free copy of ESXi to install by simply registering at their site. There are several companies in our Datacenter running multiple servers off of the Single License they registered and they administer them remotely.

No matter what provider you choose make sure you start with an OS that is designed to do Virtual hosting. Virtual systems run much smoother if you start with an operating system designed for virtual hosting and add other operating systems for the jobs you need. If you start with a standard operating system and add a virtual application under it you sometimes have to fight with the OS to get your virtual systems back on line. Start with the right tool and the work goes a lot smoother and works a lot better. (You can drive in a screw with a hammer but it is not going to look pretty, could fall apart, and when the boss sees it, you are going to have to replace it.)

rch1231 169 Posting Shark

Yes there is but it depends on which operating system you are using and what typoe of lLAN connection you have. If it is wireless then it could be something interfering with the signal.

IF it is Windows XP go to Start, Control Panel, Network Connections. Right click on Local Area Connection and check the status. If needed do a "Repair".

If it is Vista go to Network and Sharing Center and click the status option to the right of your Local Connection. Do a "Diagnose and repair" and try what they suggest.

What you really need is to find out what is causing it.

rch1231 169 Posting Shark

Just to clarify Gallery2 IS a pre-built web application that uses PHP and MySQL to store your images on the server. It creates thumbnails, allows for restricting access to specific users and is easy to administer and install.

The most important thing is to have something you are comfortable using and personally I try to pick an application that has been out for a while. Some new applications can be easily hacked or are know to be front ends for hackers to get access to your server. If you find a package you like the look of Google it and add "hacks" to the search (i.e. "gallery2 hacks") and see what pops up. It is better to be safe than sorry.

rch1231 169 Posting Shark

It may or may not be the problem but you changed the command line I suggested. You are not specifying the server IP or name in yours. Try this and see what happens:

Mine:

C:\Users\Geert\mysql -u root@localhost -pjuist fietsen

Yours

C:\Users\Geert\mysql -u root -pjuist fietsen

The first one is what php is sending vs the second which could default to 127.0.0.1 instead of localhost. You probably have the user root@127.0.0.1 in the mysql users table but if you don't have root@localhost then no connection.

Or I could be wrong but I know it once gave me fits. If it works just fine we need to figure out where else it could be dying... Have you looked at the mysql log or the httpd access and error logs for the results of the script?

rch1231 169 Posting Shark

Images can be tricky. If you just want an application that will work, is free and is already written for php and mysql look into Gallery2. Pretty easy to install and gives you options for customer logins.

rch1231 169 Posting Shark

What if you run it from the command line? In workbentch (and I will bet in QuantumDB) you manually connect to a database first through the GUI and stay connected till you disconnect. Try testing it from the command line. Get to a command prompt (Windows) or bash shell (Linux) and enter:

mysql -u root@localhost -p<root mysql password> <Database name>

If you connect then the login you are using is correct so next try your select query and see if it runs. If you do not connect then the problem is in your login to the server. **Note that there IS A SPACE between the -u and user name but NO SPACE between the -p and the password.

rch1231 169 Posting Shark

Ok if I understand correctly you want to update the empty truck field in the customer_orders table with the correct truck based on the location of the order. If that is correct then you need to use update instead of insert. Insert is to create a completely new record for the order and update is used to change the value of an existing record even if the field in question is blank.

The statement:

mysql_query("INSERT INTO `customer_order`(Truck) VALUES ('$truck')");

Attempts to insert a new record in the Customer_Order table and only fill in the field Truck with a value and set it equal to $truck.

What you need is something like:

mysql_query("UPDATE customer_order set `Truck` = '$truck' where Order_Number = '$order_number' ");

Or something pretty close.
Does that make sense?

rch1231 169 Posting Shark

Hello,

Well if you don't want to reformat your hard drive then that limits the scope of available applications to run a Virtual system. What OS are you currently running and what hardware do you have in the system (CPU's, Memory, Available HD Space)? Personally the best one I have used is VMWare's ESXi which is well written and easy to administer.

rch1231 169 Posting Shark

Hello,

It would really help if your could post part of the code giving you the problem. In the mean time have you tried your sql statement from the command line with the mysql interface? Login as the user you have defined in your script and try the code.

rch1231 169 Posting Shark

The insert will create a new record in customerorders. Are you trying to do an update instead of an insert?

The other thing I see is the ( ) around truck in the insert:

mysql_query("INSERT INTO `customer_order`(Truck) VALUES ('$truck')");

I think what you would need is:

mysql_query("INSERT INTO `customer_order.Truck` VALUES ('$truck')");

But again that will create a new record instead of updating the original. Can you verify what you really want done....

rch1231 169 Posting Shark

If I am reading your posts correctly you can get to sites via Internet Explorer but not with FireFox. If that is the case check under the File menu on Firefox and see if the "Work Off Line " option is checked. Drove me crazy one afternoon.

rch1231 169 Posting Shark

Can you connect to any site on the web or is this just one server that is a problem?

rch1231 169 Posting Shark

Hello,

You should be able to simply change the document root in the apache configuration to the new location.

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/dummy-host.example.com/forum
    ServerName dummy-host.example.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
rch1231 169 Posting Shark

Hello,

My suggestion is to grab a copy of wireshark and read the website facts and the manual. You can download and run it for free and it will give you a real look at what goes on with your system ports.

rch1231 169 Posting Shark

Well I tried the quick and easy answer. Sorry. How about this:

Start with the basics and work your way up. Double check the cable is plugged in all of the way at both ends. You would be amazed at how many loose cables cause intermittent problems and look like they are properly connected.

What does ifconfig (ipconfig for windows) report?

Can you ping the computers network port?

Can you ping any other systems?

Does this just happen some time or all of the time?

Can you ping the gateway, and each of the nameservers?

Can you query the nameservers like this:

[root@cwsvr02 cur]# nslookup txlinux.com
Server: 66.101.58.2
Address: 66.101.58.2#53

Non-authoritative answer:
Name: txlinux.com
Address: 66.100.167.20

Also try traceroute (or tracert for windows) to an IP and domain and see if there are any bottlenecks along the way?

Post what you find and we will do what we can.

rch1231 169 Posting Shark

Download and run Malwarebytes free scanner. It will tell you if there is something redirecting your web activities.

rch1231 169 Posting Shark

Have you tried changing the channel on the router or setting it to a fixed channel and speed?

Since it is a desktop and is not used with other networks how about giving it a fixed IP address and see if it stays on line.

IF I remember correctly Netgear configures the local IP as 192.168.0.1 and DHCP for the range 192.168.0.100-192.168.0.150. If this is how your is setup the I suggest either setting the desktop at the address below (or setting it under "Alternate Configuration" with it set for DHCP initially):

IP: 192.168.0.50
NM: 255.255.255.0
GW: 192.168.0.1

NS1: 192.168.0.1
NS2: 4.2.2.2

If it down not work can you send the results from running the following commands from the command line:

ipconfig
ping 192.168.0.1 <Or your gateway address>
ping 4.2.2.2
ping google.com
tracert google.com

rch1231 169 Posting Shark

Do you have any cordless phones in your house. Or the base station for one near the system with problems? They use frequencies very close to each other and sometimes interfere. It it is only one wireless that has problems then it is usually the environment causing the issue.

Also double check the IP4 settings for the network connection in question and make sure it is set to get settings automatically for IP and DNS.

rch1231 169 Posting Shark

Hello,

I suggest that you use the second setup.
Modem --> Router --> (Server, PC1, PC2, PC3, etc)
for several reasons.
1. You don't have to open ports on the routers firewall to allow the Windows systems to get to the server.
2. You can use the firewall in the router to limit access to the all of the systems and the server's samba drive share from the WAN.
3. It will also make it easier for the windows systems to find the server if they are in the same subnet. (i.e. 192.168.1.1-192.168.1.255)

Hope this helps.

rch1231 169 Posting Shark

Hello,

Your best bet is to look at their help page and see what they intend it for. I believe what they are referring to could be needing a rDNS (reverse DNS record) so theat queries against the IP address of your site respond with your site name. OR maybe your need a special MX recocrrd to point mail.mydoamin.com to a different server.

rch1231 169 Posting Shark

try this:

select id, modelname, description, other stuff 
from products 
order by modelname, description
group by modelname

you have to put it in order before you can group it.

rch1231 169 Posting Shark

Hello,

You have got to give us a little more than that. Where in "your web"? What site, what is it for and what page is it on.

rch1231 169 Posting Shark

Hello,

Personally I like defragler. It is free and by the same people who make CCleaner. Gives you many more options and a visual of what is going on.

rch1231 169 Posting Shark

You need to run your scans from safe mode (or safe mode with networking). Also on another system download UBCD4win (Ultimate Boot CD for Windows) and use it to boot the system and remove the problem files.

rch1231 169 Posting Shark

All you need to do is go buy a small (4 or 5 port ) router from your loca; computer store. You then plug the router's WAN port into the port on the DLS modem and your computers into the LAN ports and it handles the connections. It will give you an IP address like 192.168.1.X for each machine.

rch1231 169 Posting Shark

Hello,

Your problem is that the server you are trying to connect to is not set to accept outside connections from the other server in mysql. Check out the following link at the mysql site more information on howto connect.

http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html

rch1231 169 Posting Shark

Getting trick now...

Ok here goes...

select mytable.name as Name, crdt.crm as Classroom, crdt.maxdate as `Date`from (select distinct mytable.classroom as crm, max(mytable.date) as maxdate from mytable group by mytable.classroom) as crdt left join mytable where  mytable.classroom = crdt.crm and mytable.date = crdt.maxdate order by mytable.classroom

I use a similar query on a table of mine and it worked...

select Inventory.`Stock Number`, data1.Category, data1.maxpr from (SELECT DISTINCT
Inventory.Category,
Max(Inventory.Price) as maxpr
FROM
Inventory
GROUP BY
Inventory.Category) as data1 left join Inventory on Inventory.Category = data1.Category and Inventory.Price = data1.maxpr
order by data1.Category
rch1231 169 Posting Shark

It has been a while since I used the windows version but if I remember correctly it is the same syntax for both. It is odd but there is a space between -u USERNAME and no space between -pPASSWORD

On Linux I put all my sqlcode in one file (mycode.sql) and the redirect it in to mysql like this:

mysql -u root -ppassword < mycode.sql

Hope this helps.

rch1231 169 Posting Shark

Sort will work inside the loop but only for the data it is passed via the pipe which in this case is one record at a time. Why not output the file with the number at the front and then do a sort -n and it will sort the first column numerically.