This might help you alot: Click Here

I would do it like this, create an invisible isPosted value and check if on the index.php it's set with isset($_POST['isPosted'])

    <form method="post" action="index.php" enctype="multipart/form-data">
    First name:<br>
    <input type="text" name="First_Name">
    Last name:<br>
    <input type="text" name="Sur_Name">
    <input type="text" name="Cus_Address">
    <input type="text" name="Cus_Email">
    <input type="text" name="Phone_Num">
    <input type="submit" value="Submit">
    <input type="hidden" name="isPosted" value="1" />

Try the below code as the insert query and see the output

if(isset($_POST['isPosted']) && $_POST['isPosted'] == 1) {
    $insertedData = mysql_query($serverConnection,"INSERT INTO customertable(CustomerId,FirstName, SurName, Address, PhoneNum, Email, ProductPurchase) VALUES( 'NULL', '$_POST[First_Name]', '$_POST[Sur_Name]', '$_POST[Cus_Address]', '$_POST[Phone_Num]', '$_POST[Cus_Email]', '3')" ) or die(mysql_error());
} else {
    die('No POST data found.');

It would be much easier to use the PDO class for MySQL queries.
Also, try to make a rule for your case typing on your Variables.

Try this, first create your PDO server connection as $connection

$customer_id = $_POST[Customer_ID];
$first_post = $_POST[First_Post];
$sur_name = $_POST[Sur_Name];
$cus_address = $_POST[Cus_Address];
$phone_num = $_POST[Phone_Num];
$cus_email = $_POST[Cus_Email];
$product_purchase = $_POST[Product_Purchase];

$sql = 'INSERT INTO customertable( `CustomerID`, `FirstName`, `SurName`, `Address`, `PhoneNum`, `Email`, `PurchaseProduct`) VALUES(:customer_id, :first_post, :sur_name, :cus_address, :phone_num, :cus_email, :product_purchase)';

$query = $connection->prepare($sql);
    ':customer_id'      =>  $customer_id,
    ':first_post'       =>  $first_post,
    ':sur_name'         =>  $sur_name,
    ':cus_address'      =>  $cus_address,
    ':phone_num'        =>  $phone_num,
    ':cus_email'        =>  $cus_email,
    ':product_purchase' =>  $product_purchase,
broj1 commented: This i the way to go +11

Mine is PHPEd from NuSphere, amazing product, it's not free but it's worth the money.

Code suggestion is not case sensitive, great syntax highlighting, framework support, etc.

diafol commented: Looks interesting +15

Got my solution.

  MAX(IF(t.AttributeClassValueId = '1', t.AttributeClassValue, NULL)) AS Atribute1,
  MAX(IF(t.AttributeClassValueId = '2', t.AttributeClassValue, NULL)) AS Atribute2,
  MAX(IF(t.AttributeClassValueId = '3', t.AttributeClassValue, NULL)) AS Atribute3,
  MAX(IF(t.AttributeClassValueId = '4', t.AttributeClassValue, NULL)) AS Atribute4,
  MAX(IF(t.AttributeClassValueId = '5', t.AttributeClassValue, NULL)) AS Atribute5
FROM CatSys_products p
    LEFT JOIN CatSys_productAttributeClassValuesFromProducts t ON = t.ProductId
    LEFT JOIN CatSys_productAttributeClassValues a ON t.AttributeClassValueId =
GROUP BY p.SKU, p.productName

As far it seems, you did not give permission to the Java to load properly.

I think that it is your PHP tags and other little problems.
Try this.

    $balance = $match_value['balance'];
    $verified = $match_value['verified'];
    <?php if ($verified == 1) {
        $verified = $balance;
    } else {
       echo '<a class="btn btn-danger" href="verified.php"> not verified </a>';

If I would have to chose, I would chose the browser, it is more easier, but also the media players it is okay.

For the browser and media player look at Java FX. -> WebView

Can you post an sqlfiddle ?

Cereal thanks for the heads up, it's simpler than i tought :)

This is my solving of the problem, with your help.


    $i = 0;
    $j = 1;
    foreach($garantie->TESTverificaFiecareCodDinCos($comanda) as $camp) {       
        if(!empty($camp['cod_garantie'])) {

        if($i > 0) {
            $camp['pozitie'] = $camp['pozitie'] + $i;
        if(!empty($camp['cod_garantie'])) {
            echo ($camp['pozitie']-1)."\t\t".$camp['matnr']."\t\t".$camp['mfrpn'].'<br />';
        } else {
            echo $j."\t\t".$camp['pozitie']."\t\t".$camp['matnr']."\t\t".$camp['mfrpn'].'<br />';


Objective C is a bit tricky with numbers, you can mix it with C but the NSNumbers are tricky. Check out the NSNumbers and operators, you have to assign the values of the NSNumber to a variable and then you cand use this aritmethic operations.

You log into the Google Webmasters select your page then click on Google index and then Remove URLs and create a new removal request.

Yes, in this case you are echoing the last row from the database because your script continues after the while loop.

As @pritaeas said, you have to echo inside your while

Kevinyu, Bootstrap is the needed framework for the screen resolution, at least one of them.

kevinyu commented: Can it be just added to all kinds of PHP frameworks? Or without the need of using frameworks. +2

I can see the errors, but this looks like it is for your homework.
Please be polite, and dont just paste the question.

What @iamthwee is telling you to do is that you have to create 1+ tables that will link with the student ID to your students table.

Please reffer to this link JOINS

put on your first line ob_start(); and on the last line ob_flush();



*   Your code goes here



The simplest way is that you have to drop the database and recreate it :)

Check your privileges on the user for MySQL, there is a privilege you have to set.
If it is root, then there is no drop problem.

Please reffer to this.

UPDATE name SET first_name = REPLACE (first_name, 'a', 'b') WHERE blabla LIKE '%blabla%';
UPDATE name SET first_name = REPLACE (first_name, 'a', 'b') WHERE blabla = 'blabla';

Well echo is the syntax to display a text in PHP.

Everything between '' or "" is a string.
You are concatenating two or more strings with (dot) .

$stuf is the array of the resultset from the Database.
$stuff['heading'] is the value from the dabase of the heading column, based on you selection.

it's a HTML tag for Headers.

The weird problem came from the lack of session_start();


$i = 0;
while($row = mysql_fetch_array($sql))
    echo '<tr '.(($i <= 6)?'class="yourClass"':'class="yourOtherClass"').'><td>yourText</td></tr>';


    $i = 0;
while($row = mysql_fetch_array($sql))
    echo '<tr '.(($i <= 6)?'style="border: 1px solid green"':'style="border: 1px solid black"').'><td>yourText</td></tr>';

well you have to pass your form value into a variable to pass it to a session $username = $_GET['username'] and then use the $_SESSION['username'] = $username; or $_GET['username'] = $_SESSION['username'];

I don't actually understand your question. What do you need it for ?

kjeu_kach commented: I want to make code as the image +0


I've built a timekeeping aplication from a fingerprint machine with automatic import to db and I'm getting some reports.
One report is that I'm getting the employees time if they are late from work.

But my table is small with 20.000 entries, but with the following query, the results are generating in 9.7 seconds, and its really slow.
I have to use INNER JOIN and some subselects for getting the minimal hour and other stuff.

Could I optimize this query more ?

`SELECT,, SEC_TO_TIME(AVG(TIME_TO_SEC(p.ora))) as timp, u.user, p.tip, u.program_de_la FROM utilitar.pontaj as p 
    INNER JOIN utilitar.pontaj_usr as u ON u.user = p.user 
    WHERE p.user NOT IN('000127','000126')
    AND = '2012-05-08' AND (SELECT MIN(ora) FROM utilitar.pontaj WHERE data = '2012-05-08' AND user = p.user) > u.program_de_la AND p.tip in('A','C') 
    AND u.program_de_la NOT IN('','-')
    AND u.program_pana_la NOT IN('','-' )
    GROUP BY p.user ORDER BY timp ASC, ASC`


"data"        "name"                    "timp"        "user"    "tip" "program_de_la"
"2012-05-08"    "xxxxxxxxxxxxxxxxxxxx "  "07:08:00"   "000030"  "A"   "07:00"
"2012-05-08"    "34tgyhhgddfgdgdf"       "08:32:00"   "000001"  "A"   "08:30"
"2012-05-08"    "34tgyhhgddfgd"          "08:33:00"   "000132"  "A"   "08:30"
"2012-05-08"    "34tgyhhgddfgdgdf"       "08:34:00"   "000187"  "A"   "08:30"
"2012-05-08"    "34tgyhhgddfgdgdf"       "08:38:00"   "000039"  "A"   "08:30"
"2012-05-08"    "34tgyhhgddfgdgdf"       "09:14:00"   "000046"  "A"   "08:30"
"2012-05-08"    "34tgyhhgddfgd"          "14:23:00"   "000101"  "A"   "14:00"

The results are correct but a little slow.

Hey, this is my first post here, glad to be here and learn from you guys!

what i'm trying to do is this:

I would like to enter 2 names and then hit a number from lets say 1 to 10, and i have the array Q1,Q2... etc. these should be the questions. I want to shuffle them and if I press every time the same number it should give me a another question for another name.

How can I do this? I saw this kind of app on the iphone, and it was fun! But since I'm new to C++, i need some kind of help.
Thank you!



using namespace std;

int main()
const int QA = 10;
string question[QA] = {"Q1", "Q2", "Q3", "Q4", "Q5", "Q6", "Q7", "Q8", "Q9", "Q10", };
string name1, name2;
int choice;

cout << "Enter Name1: ";
cin >> name1;
cout << "Enter Name2: ";
cin >> name2;