22 October 2008, 1:00 PM

Handy code to count number of rows in MySQL. I use the code to search return results of how many posts are in on Catergry on my blog.

$db_con = mysql_connect("localhost", "username", "password");
mysql_select_db("database", $db_con);

$result = mysql_query("SELECT * FROM post WHERE catergory='Example'"$db_con);
$num_rows = mysql_num_rows($result);

echo $num_rows;




22 October 2008, 12:51 PM

Day 6
Today i continued to install firmware to products.

Day 7
Today i finished off installing firmware to products and James set me up with some work to do with Faxes. I had to test to see if the older Faxes worked with network. Also i got some faxes ready for me to test tomorrow.




17 October 2008, 11:17 PM

When creating custom design in C# you want to move your application these codes will enable the whole application or just the outsides to move.

using Microsoft.Win32;
using System.Runtime.InteropServices;

On Form1 add this code


public Form1()
        {
            InitializeComponent();
        }
            public const int WM_NCLBUTTONDOWN = 0xA1;
            public const int HT_CAPTION = 0x2;

            [DllImportAttribute("user32.dll")]
            public static extern int SendMessage(IntPtr hWnd,
                int Msg, int wParam, int lParam);

            [DllImportAttribute("user32.dll")]
            public static extern bool ReleaseCapture();

        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                ReleaseCapture();
                SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
            }
        }



Or if you wish to apply it to move by an object only add

private void Object_MouseDown(object sender, MouseEventArgs e)
       {
            if (e.Button == MouseButtons.Left)
            {
                ReleaseCapture();
                SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
            }
        }




17 October 2008, 10:45 PM

Handy script to set an Intro on to application. Firstly create Form1 and then in Form1 create Form2.

Add a timer named "timer1". Set timer1 properties to Enabled is "True" and Interval is "5000" (5 Seconds).

Now use this script on timer tick

private void timer1_Tick(object sender, EventArgs e)
    {
        Form2 ShowForm2 = new Form2();
        this.Hide();
        ShowForm2.Show();
        timer1.Stop();
    }

Remember than Form1 is only hidden so when Form2 is closed Form1 will still be active in background.




17 October 2008, 10:31 PM

Day 3
Again today I was working with James installing firmware to products. Today I also moved onto electronically unlocking a product installing firmware and then electronically locking after the firmware had finish installing.

Day 4
Because the firmware is time consuming I was counting this process today. Its fun as you have to use various commands on the CMD to access the products.

Day 5
I did not attend work due to illness.




15 October 2008, 11:02 AM

At the beggeing of the week i started work experience at BT (Addres Park).

Day 1
On arrival i reported to resciprtion and received a site pass so i was allowed on site. After i arrive i meet Julie she run me though health and safety and other site rules. After that i meet my supervisor Kevin who show me around some of the rooms they use. After lunch Kevin set me up to test a phone.

Day 2
Today Kevin sorted me out some work with James who deals with other products. Ive been helping James install firmware on products and also testing.




7 October 2008, 7:07 PM

Still trying to come together what console is the best. Im the current owner of a PlayStation 3 and i think it has to be the best console but i want you lot to do my poll and give me your results.

Remeber your voting for the best console not just the one you got.
[include]inc/poll-console.php[/include]

After you vote results will be displayed.




6 October 2008, 8:49 PM

Just a general blog about one of first project created in C# most people do it and its most common way to start C#.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}




We have a large portfolio of work we have completed for clients. Our portfolio always carries our current new iPhone applications. Take a look

Follow us on Twitter, We aim to provide Live Information - @olliekett
 

Ollie Kett Designs - Tracking System