Also to add to diafol's comment, you could add a die() statement after your mysql_query()

$sqlb = mysql_query("SELECT SUM(projb.amunt) AS totalpsamt, SUM().... AS ....
        FROM projb
        INNER JOIN proja ON projb.projid = proja.projid
        INNER JOIN parti ON proja.parid = parti.parid
        INNER JOIN pstotal ON proja.projid = pstotal.projid
        WHERE proja.projid = $projid
        AND parti.parid =$parid") or die(mysql_error());       

I usually construct my query into a variable $sql and that way if I get an SQL error I can output the error as well as the query to check it for errors.

$sql = "SELECT SUM(projb.amunt) AS totalpsamt, SUM().... AS ....
        FROM projb
        INNER JOIN proja ON projb.projid = proja.projid
        INNER JOIN parti ON proja.parid = parti.parid
        INNER JOIN pstotal ON proja.projid = pstotal.projid
        WHERE proja.projid = $projid
        AND parti.parid =$parid";

$sqlb = mysql_query($sql) or die(mysql_error()."<br />Query: ".$sql);

further to this you will need to edit your php.ini file and change date.timezone = "Europe/Paris" to date.timezone = "America/Your_City"

This is a more suitable solution

try this, remembering to change "Your_City" to the city you live in.

    <?php
    //Daylight Savings
    date_default_timezone_set('America/Your_City'); 
    $todayDate = date("l, F d, Y, g:ia");
    echo "Daylight Savings is on ".$todayDate."<br>";
    ?>
LastMitch commented: Thanks for the solution! +5

this will give you the result you want: $todayDate = date("l, F d, Y, g:ia");

My advice is to think about what you want to acheive and use the PHP Manual to learn what you need.

It will help a lot if you have previous programming experience with other languages

Good Luck!

It would look something like this

<?php
    // assuming you have connected to the database and set up the table
    // and your user is already logged in and jsut needs to "punch in"

    $sql = 'SELECT `action_type` FROM `users` WHERE `username` = \'{$username}\' LIMIT 1';
    $result = mysql_query($sql);
    $row = mysql_fetch_assoc($result);
    if ( $row['action_type'] == 'IN' ) {
        // display code to puch out
    } else {
        // display code to punch in
    }
?>

I haven't tested this but it should work with some modifictaion with your existing code.

I think you may need to do some research on the Javascript onunload & onbeforeunload events. Maybe have them call an ajax function.

here is an example of the usage.

[QUOTE=ShawnCplus;1050741]What he said, it's been a long day :)[/QUOTE]

It happens to the best of us ;)

[QUOTE=feddie1984;1050627]Hi All,

I have the following code:

[CODE]$requester_email = $_POST['requester_email'];
$requester_name = $_POST['requester_name'];
$todays_date = $_POST['todays_date'];
$Start_Date = $_POST['Start_Date'];
$End_Date = $_POST['End_Date'];
$Department = $_POST['Department'];
$No_Engineers_Required = $_POST['No_Engineers_Required'];
$Prefered_Engineers = $_POST['Prefered_Engineers'];
$Customer_Name = $_POST['Customer_Name'];
$Location = $_POST['Location'];
$Type_Of_Job = $_POST['Type_Of_Job'];
$Job_Ref_No = $_POST['Job_Ref_No'];
$Additional_info = $_POST['Additional_info'];[/CODE]

The help I need is the information for Prefered_Engineers comes from a collection of checkboxes.

This code is here:

[CODE]















[/CODE]

The value passed is 'Array'.

Can anyone help so that all of the selected checkbox values are passed.

Regards,

T[/QUOTE]

As much as I try and aviod overposting more experienced and respected posters, if you remove the [] that will only let you select 1 of the checkboxes and not multiple. If you want multiple You need to loop through them. Try

[CODE]
<?php
$engineers = $_POST['Prefered_Engineers'];
foreach($engineers as $engineer) {
echo $engineer;
}
?>
[/CODE]

Hope that helps

ShawnCplus commented: good spot +6

[QUOTE=elanorejoseph;1048412][CODE]hi how can i make a drop down menu usibg java script.... please help its urgent[/CODE][/QUOTE]

They are normaly done in HTML.

[CODE=html]

Option 1 Option 2 Option 3

[/CODE]

Is that what you mean? Please be more specific if not

[QUOTE=Carrots;1043226]Hi,

I was wondering why the CREATE TABLE query in my code seems to be called automatically, whilst in the example below from w3schools, there is a line which explicitly calls the CREATE TABLE query.

Why is that the query in the w3schools example isn't ran twice?

My code:
[code=php]
<?php
$connectionname = mysql_connect("localhost","XXX","XXX");
if (!$connectionname)
{
die('Could not connect: ' . mysql_error());
}

// Create table
mysql_select_db("databasename", $connectionname);
$sqlcommandvariable =
"
CREATE TABLE Userssss
(
userID int(8),
userName varchar(15),
firstName varchar(15),
lastName varchar(15),
password varchar(32)
)

";

if (!mysql_query("$sqlcommandvariable")) die(mysql_error());
else {
echo "success in table creation.";
}

mysql_close($connectionname);
?>
[/code]

W3schools example:
[code=php]
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// Create database
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}

// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";

// Execute query. Why is this called explicitly? When my query runs automatically?
mysql_query($sql,$con);

mysql_close($con);
?>
[/code]

I'm finding this confusing, so if anyone could explain where the difference is I'd most appreciate it.

Many thanks! :)[/QUOTE]

I am a little confused to what you are asking but I think you might mean.

[CODE=PHP]
//your code is put into an if statement
<?php if (!mysql_query("$sqlcommandvariable")) die(mysql_error()); ?>

// where the www.w3schools is just calling it
<?php mysql_query($sql,$con); ?>
[/CODE]

is that what you meant?

Carrots commented: Thanks for your help!! :) +1

try using str_replace

[code=php]
<?php
$source = "string with • ";
$newString = str_replace("•", "", $source);

[/code]

that should work

rickya100 commented: Made me remember about trying the basics first! +2