Szabi Zsoldos 26 Learner and helper guy

well you have campus_name not company_name, check that please.

Szabi Zsoldos 26 Learner and helper guy

Put these two lines at the top of your file and tell us what errors does it give to you.

<?php

error_reporting(E_ALL);
ini_set("display_errors", 1);

?>

Again read my first post because I gave you the solution.

You are doing this wrong.

<select name="company_name">
<option value="">--- Select a Company ---</option>
<?php
while($row = mysql_fetch_assoc($retval_selectcompany)) {
echo "<option name="$row["company_name"]";>" }
?>
</option>

Wrong HTML usage and wrong PHP usage also.
I rewrote it to you in a correct way.

<select name="company_name">
<option value="">--- Select a Company ---</option>
<?php

while($row = mysql_fetch_assoc($retval_selectcompany)) {
    echo '<option value='.$row["company_name"].'>'.$row["company_name"].'</option>'; 
}

?>

</select>
Szabi Zsoldos 26 Learner and helper guy

just saw that i forgot a ' in $array['yourField1']

Szabi Zsoldos 26 Learner and helper guy

Something is not right in your logic.

$company_id = $_POST['company_id'];
$company_name = $_POST['company_name'];

// What do you do with these post`s ?

You do not close your <select> form

A simple logic is this. Also try using PDO classes instead of the deprecated MySQL.

<?php

echo '<select name="yourName">';

while($arr = mysql_fetch_array($sql)) {
  echo '<option value="'.$arr['yourField1].'">'.$arr['yourField2'].'</option>';
}

echo '</select>';

?>
Szabi Zsoldos 26 Learner and helper guy

it is almost like asos.com :))

Szabi Zsoldos 26 Learner and helper guy

As Dani said, you could try using jQuery also, it has all of these functionalities enable right out of the box.

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

Yes, the EMPTY(exception) has to have the Position of previous Position + 1
This means that the non-exeption have to shift their values up by one also.

Szabi Zsoldos 26 Learner and helper guy

Well something like this like in a while when comparing currency changes, but I just dont get it ...

echo '<table border="1" cellpadding="5">';

$previous = null;
foreach($garantie->TESTverificaFiecareCodDinCos($comanda) as $camp) {
    echo '<tr><td></td><td>'.$camp['cos'].'</td><td>'.$camp['pozitie'].'</td><td>'.$camp['cod_garantie'].'</td><td>'.$camp['matnr'].'</td></tr>';
    if($previous['cod_garantie'] != '') {
        echo '<tr><td><b>EMPTY</b></td><td></td><td><b style="color: red;">'.($previous['pozitie']+2).'</b></td><td></td><td></td></tr>';
    } else {
        $previous = $camp;
    }       
}

echo '</table>';

de879614b34de7489f01711f8150dbfb

Szabi Zsoldos 26 Learner and helper guy

Hey guys,

I'm having difficulties with a problem.
I iterate over an array of data with X rows

And i have the positions of each row incremented, i would like that when i found an exception i shift all the position id's so after each exception the next ID has to be +2 as seen in the second attachment.

After each exception i woul like to have a free unused position so i can use it later.
Any idea of how could i make this ?

Picture one is the data array

368b1e79027f622224713a0d830a0fac
Picture two is the desired result
920c682fad358fd2046f18d935e6a92a

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

Could you be more specific please ?
A domain is the name of your public address on the internet. Ex www.google.com is a domain. Now there are other domains in the network area.

Szabi Zsoldos 26 Learner and helper guy

The db verify is needed or you can use different methods with tokens and sessions.
After inserting the value, you can redirect the user and when he hits F5 it will just refresh the page.

Szabi Zsoldos 26 Learner and helper guy

Use my script from above and it will give you these details :)

Szabi Zsoldos 26 Learner and helper guy

So if i understand, it lets you create more than one user with the same name ?

Szabi Zsoldos 26 Learner and helper guy

Why did i got my comment voted down ?

Szabi Zsoldos 26 Learner and helper guy

Use MODIFY instead of CHANGE

Szabi Zsoldos 26 Learner and helper guy

On editing a post, the file upload function does not work on Google Chrome (Win 8).
I wanted to add a screenshot on editing but did not work.

Console error:

FB.getLoginStatus() called before calling FB.init(). all.js:56
POST http://www.daniweb.com/posts/js_modify_message 404 (Not Found) jquery.min.js:4
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

Please use this and run your query in the phpmyadmin or your admin tool.

 $sql = "UPDATE `userprofile` SET `user_name` = $username
                                     `email` = $email
                                     `description` = $description
                                WHERE user_id =". $_GET['id'];

 echo $sql;                             
Szabi Zsoldos 26 Learner and helper guy

You cannot pass a javascript variable to php directly.

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

post all your code :))

Szabi Zsoldos 26 Learner and helper guy
$result = ("SELECT * FROM area WHERE county = '".$county."'");

echo $result;
Szabi Zsoldos 26 Learner and helper guy

echo it without mysql_query

Szabi Zsoldos 26 Learner and helper guy

echo the $result without mysql_query and see the query, and then run that query in phpmyadmin

Szabi Zsoldos 26 Learner and helper guy

Try this

$result = mysql_query("SELECT * FROM area WHERE county = '".$county."'");

But the query looks allright, try to run your query from the phpmyadmin or the administrative tool you have, and see the results there first.

Szabi Zsoldos 26 Learner and helper guy

Here you go, a working example :)

Your test.xml is below

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
    <Physical>
        <Catalog>
        <EquipmentSpec>
            <Reference>MAT_4</Reference>
            <Type>Duplexeur</Type>
            <Characteristic><CharacteristicName>Tilt</CharacteristicName>
            <CharacteristicValue>0</CharacteristicValue></Characteristic>
        </EquipmentSpec>
        <EquipmentSpec>
            <Reference>MAT_6890</Reference>
            <Type>Node</Type>
            <Characteristic><CharacteristicName>Tilt</CharacteristicName>
            <CharacteristicValue>2</CharacteristicValue></Characteristic>
        </EquipmentSpec>
        <EquipmentSpec>
            <Reference>MAT_50</Reference>
            <Type>Single</Type>
            <Characteristic><CharacteristicName>Tilt</CharacteristicName>
            <CharacteristicValue>5</CharacteristicValue></Characteristic>
        </EquipmentSpec>
        </Catalog>
        <Installed>
            <Equipment>
                <Id>26</Id><Reference>MAT_4</Reference>
                <Characteristic><CharacteristicName>Height</CharacteristicName><CharacteristicValue>160</CharacteristicValue></Characteristic>
            </Equipment>
            <Equipment>
                <Id>27</Id><Reference>MAT_6890</Reference>
                <Characteristic><CharacteristicName>Height</CharacteristicName><CharacteristicValue>140</CharacteristicValue></Characteristic>
            </Equipment>
            <Equipment>
                <Id>28</Id><Reference>MAT_50</Reference>
                <Characteristic><CharacteristicName>Height</CharacteristicName><CharacteristicValue>180</CharacteristicValue></Characteristic>
            </Equipment>
        </Installed>
    </Physical>

Then your simple xml function continues

<?php

$xml = simplexml_load_file("test.xml"); 

/**
* You can use an array and iterate over it for your database if you want to.
* $array = array();
*/
foreach($xml as $key=>$val) {
    foreach($val as $key2=>$val2) {
        $Type = $val2->Type;

        foreach($val2 as $key3=>$val3) {
            if($val3->CharacteristicName == 'Height') {
                $Height = $val3->CharacteristicValue;
            }
        }
    }
}                            

?>
Szabi Zsoldos 26 Learner and helper guy

Did you try using SimpleXML ?

Szabi Zsoldos 26 Learner and helper guy

print out the $spec first

print_r($spec) and see your variables

Szabi Zsoldos 26 Learner and helper guy
  1. Do you close your form ?
  2. Did you try the

    print_r($_POST);

    or

    print_r($_REQUEST);

    ?

Szabi Zsoldos 26 Learner and helper guy

try this in your function.

echo '<pre>';

print_r($this->input->get(ALL));
or 
print_r($this->input->post(ALL));

die();
Szabi Zsoldos 26 Learner and helper guy

I have never had problems with my frameworks with TinyMCE.
In this case I was using Codeigniter

84ead468266664e43febab31ad2225b0

Add to your javascript this mode : "textareas"

Than the saving to the DB

    public function creaza_anunt() {
        $new_anunt_insert = array(
            "poster"    =>  $this->session->userdata('poster'),
            "title"     =>  ucfirst($this->input->post('title')),
            "keywords"  =>  $this->input->post('keywords'),
            "content"   =>  ucfirst($this->input->post('content')),
            "meta_title"=>  $this->seofy($this->input->post('title'))
        );

        $insert = $this->db->insert('anunturi', $new_anunt_insert);
        return $insert;
    }

Also please post your FORM source code

And after submiting your form write this on the top of your submited page.

echo '<pre>';
print_r($_REQUEST);

And show us your results please

Szabi Zsoldos 26 Learner and helper guy

And I was thinkng that my iPad browser got messed up, the css seems to be messed up on my 3rd gen iPad.

Chrome for iPad

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

First of all you have to know on what Operating System do you want to go.
Then you have to create some restfull api's that comunicate with your database.
You can use HTML5 included in your android or ios, or create your interface with the api's.

Szabi Zsoldos 26 Learner and helper guy

It depends on what you want to do, for example, dont start with the heavy Zend framework, since that will mix your ideas about programming at your level.

Before you can understand frameworks, you have to know a little bit about OOP, since frameworks are based on OOP.

Szabi Zsoldos 26 Learner and helper guy

Please post your EXPLAIN query like this.

    EXPLAIN SELECT * FROM games where games.league='".$receivedleague."' AND games.gamedate >='".$todaydate."' AND
    '".$elnowla."' <= games.eldatetime AND (Not EXISTS(SELECT gameplayed.gameid,gameplayed.userid FROM gameplayed WHERE games.id=gameplayed.gameid AND gameplayed.userid='".$Userid."')) order by games.eldatetime asc limit 0,2
Szabi Zsoldos 26 Learner and helper guy

Not really, they target mostly your IP not your login script.

Szabi Zsoldos 26 Learner and helper guy

Ok, good work on debuging your mistakes! :)

Szabi Zsoldos 26 Learner and helper guy

You loaded the locale class, did you eliminate that and it worked ?

Szabi Zsoldos 26 Learner and helper guy

Please post the code where you are declaring your languages.

Szabi Zsoldos 26 Learner and helper guy

You are trying to redeclare the locale class in a file of yours.

Szabi Zsoldos 26 Learner and helper guy

It looks like that there is something with my particular blog, it redirects for some resource, I've installed the plugin to other pages and it works without problems! :)

Szabi Zsoldos 26 Learner and helper guy

Sorry but we cannot help you untill you dont tell us your problem.
By the way this looks like a copy/paste source code from a page.

Szabi Zsoldos 26 Learner and helper guy

You dont need the foreach

just use

$cat_data->id
$cat_data->name
$cat_data->image
$cat_data->p_cat
Szabi Zsoldos 26 Learner and helper guy

Hi guys,

I've created a simple plugin for Wordpress that interacts with an API in the backend.
The problem is that everything is inserted twice in the database, and I cannot figure out why.

The form is submiting only once, not twice.

What could it be ?
Redirects from my .htaccess ?

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

# END WordPress

My function from the plugin, this is the logs table and after that i'm calling get_curl_data() function.

function verifica_disponibilitate_curl($post) {
    $sdstr = '';

    global $wpdb;
    $tblname=$wpdb->prefix."disponibilitate_log";

    $insert = "INSERT IGNORE INTO ".$tblname." (data_verificata) VALUES('".$wbdb->escape($post['data_verificata'])."');";

    $rows_affected = $wpdb->query($insert);
    $curl = get_curl_data($post['data_verificata']);

    if(count($curl) == 0) {
        $sdstr = 'Datele de configurare API nu sunt corecte!';
    } else {
        $sdstr = $curl['mesaj'];
    }

    return $sdstr;
}#function verifica_disponibilitatea

The get_curl_data() function looks like this.

function get_curl_data($data_verificata = '') {

    global $wpdb;
    $tblname=$wpdb->prefix."disponibilitate_config";

    $select = "SELECT * FROM ".$tblname."";
    $query = $wpdb->get_results($select);  

    foreach($query as $data) {
    // Datele de conectare pentru API 
        $username  = $data->username; 
        $password  = $data->password;
    } 
    // Data Cautata         
    $data = $data_verificata; 

    // Apelarea host-ului pentru rezultate impreuna cu data cautata 
    $host = "http://bysobi.com/api/disponibilitate/data/api/".$data; 

    // Initializare curl pentru a extrage rezultatele 
    $process = curl_init($host); 
        curl_setopt($process, CURLOPT_HEADER, FALSE); 
        curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password); 
        curl_setopt($process, CURLOPT_TIMEOUT, 30); 
        curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE); 
    $response = curl_exec($process);
    return json_decode($response,true);
}
Szabi Zsoldos 26 Learner and helper guy

Please post this line from the specified file.

(T_IF), expecting function (T_FUNCTION) in /home/promanx2/public_html/include/session.php on line 455

Szabi Zsoldos 26 Learner and helper guy

Please post the line 70 from your login-success.php fie
It seems that you have a host string instead of a $host variable in your connection string.

For this you should create a dbconfig.php file that you would include in each of your files.

Szabi Zsoldos 26 Learner and helper guy

What do you exactly mean ?
I just see static images on that page.