Archive for March, 2006
5 mysql tips
By Justin Silverton
These are some tips that may help you out when dealing with mysql tables (known in 4.1 and below).
1) char and varchar are case sensitive
example:
if you have a table that contains the following:
table newtable (
name varchar(32)
)
name contains the name “John Smith”.
the following statement: “SELECT * from newtable where name=’john smith’ will return our record.
to stop this from happening, use the following when you create your table:
CREATE TABLE newtable (
name VARCHAR(32) BINARY
)
2) Varchar type is limited to 255 characters
3) Varchar trailing spaces are stripped
example: insert into newtable values(’Test with no spaces ‘);
select concat(name, ‘no spaces’) FROM newtable;
output will be: Test with no spacesnospaces
Varchar works this way, because it saves space by stripping the spaces.
if you need to keep the trailing spaces in the data you are adding to a varchar type,
you need to use the text or blob types.
4) operator
The (or) operater is a logical operator
example: select ’string1′ ’string2′ will not return ’string1string2′
5) function parameters
This issue has caused me many headaches in the past, and I am not sure why this issue was never fixed. If there is a space
between the paramater list and an internal function that you want to execute, it will return an error.
example: select min (my_field) from mytable wil return an error, while select min(my_field) from my_table will not
1 commentHow to manually remove a program in windows XP
By Justin Silverton
The following can help in those situations on windows, when you try and un-install a program and it either doesn’t remove itself from the main add/remove programs menu or an error message comes up because the un-installer is corrupted.
Warning: editing your registry impropery can cause damage to windows. Use the following at your own risk:
1. Click Start, and then click Run.
2. In the Open box, type regedt32, and then click OK.
3. In Registry Editor, find the following key:
HKEY_LOCAL_MACHINESOFTWARE
MicrosoftWindowsCurrentVersion\Uninstall
4. In the left pane, click the Uninstall registry key, and then click Export on the File menu.
5. In the Export Registry File dialog box that appears, click Desktop in the Save in list, type uninstall in the File name box, and then click Save.
6. Each key listed under Uninstall in the left pane of Registry Editor represents a program that is displayed in the Currently installed programs list of the Add or Remove Programs tool. To determine which program that each key represents, click the key, and then view the following values in the details pane on the right:
DisplayName: The value data for the DisplayName key is the name that is listed in Add or Remove Programs.
-and-
UninstallString: The value data for the UninstallString key is the program that is used to uninstall the program.
7. After you identify the registry key that represents the program that you removed but which is still displayed in the Currently installed programs list of Add or Remove Programs, right-click the key in the left pane of the Registry Editor window, and then click Delete.
Click Yes in response to the “Are you sure you want to delete this key and all of its subkeys?” message.
8. On the File menu, click Exit to quit Registry Editor.
9. Click Start, click Control Panel, and then click Add or Remove Programs.
In the Currently installed programs list, verify that the program whose registry key you deleted is no longer listed.
10. Do one of the following:• If the program list is not correct in Add or Remove Programs, double-click the Uninstall.reg file that you saved to your desktop in step 5 to restore the original list of programs in the registry.
-or-
If the program list is correct in Add or Remove Programs, right-click the Uninstall.reg file on your desktop, and then click Delete.
Update
an anonymous poster has an addition to my post:
It’s worth mentioning that this doesn’t actually remove any of the files or reg keys the program created when it was installed, it just removes the ‘record’ Windows has which tells it the program has been installed.An alternate way to do this is to use msizap :http://msdn.microsoft.com/library/default.asp?url=/library/en us/msi/setup/msizap_exe.asp
1 comment




