Szabi Zsoldos 26 Learner and helper guy

This might help you alot: Click Here

Szabi Zsoldos 26 Learner and helper guy

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'])

    <h2><i>PLEASE FILL IN YOUR DETAILS TO COMPLETE YOUR ORDER</i></h2>
    <form method="post" action="index.php" enctype="multipart/form-data">
    First name:<br>
    <input type="text" name="First_Name">
    <br>
    Last name:<br>
    <input type="text" name="Sur_Name">
    <br>
    Address:<br>
    <input type="text" name="Cus_Address">
    <br>
    Email:<br>
    <input type="text" name="Cus_Email">
    <br>
    Phone:<br>
    <input type="text" name="Phone_Num">
    <br><br>
    <input type="submit" value="Submit">
    <input type="hidden" name="isPosted" value="1" />
    </form>

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.');
}
Szabi Zsoldos 26 Learner and helper guy

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);
$query->execute(array(
    ':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
Szabi Zsoldos 26 Learner and helper guy

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
Szabi Zsoldos 26 Learner and helper guy

Got my solution.

SELECT p.SKU,
  p.productName,
  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 p.id = t.ProductId
    LEFT JOIN CatSys_productAttributeClassValues a ON t.AttributeClassValueId = a.id
GROUP BY p.SKU, p.productName
Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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

<?php
    $balance = $match_value['balance'];
    $verified = $match_value['verified'];
?>
<tr>
    <th>Balance:</th>
    <td> 
    <?php if ($verified == 1) {
        $verified = $balance;
    } else {
       echo '<a class="btn btn-danger" href="verified.php"> not verified </a>';
    } 
    ?>
    </td>
</tr>
Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

Can you post an sqlfiddle ?

Szabi Zsoldos 26 Learner and helper guy

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

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

    <?php

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

        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 />';
        }
        $j++;
    }

    ?>
Szabi Zsoldos 26 Learner and helper guy

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.

Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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
Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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

<?php

ob_start();

/**
*
*   Your code goes here
*
**/

ob_flush();

?>
Szabi Zsoldos 26 Learner and helper guy

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

Szabi Zsoldos 26 Learner and helper guy

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.

Szabi Zsoldos 26 Learner and helper guy

Please reffer to this.

UPDATE name SET first_name = REPLACE (first_name, 'a', 'b') WHERE blabla LIKE '%blabla%';
OR
UPDATE name SET first_name = REPLACE (first_name, 'a', 'b') WHERE blabla = 'blabla';
Szabi Zsoldos 26 Learner and helper guy

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.
and <h2></h2> it's a HTML tag for Headers.

Szabi Zsoldos 26 Learner and helper guy

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

SOLVED

Szabi Zsoldos 26 Learner and helper guy
$i = 0;
while($row = mysql_fetch_array($sql))
{
    echo '<tr '.(($i <= 6)?'class="yourClass"':'class="yourOtherClass"').'><td>yourText</td></tr>';
    $i++;
}

or

    $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>';
    $i++;
}
Szabi Zsoldos 26 Learner and helper guy

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'];

Szabi Zsoldos 26 Learner and helper guy

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
Szabi Zsoldos 26 Learner and helper guy

Hello,

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 p.data,u.name, 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 p.data = '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, u.name ASC`

Results

"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.

Szabi Zsoldos 26 Learner and helper guy

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!

#include <stdlib.h>
#include <iostream>
#include <string.h>

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;
    

    system("PAUSE");
    
}