Im trying to explode the value of my query to input field so im able to edit them: this what I've got so far ::

$temp = explode(',',$sizes);
        if($temp){
                $ctr_size='';       
                foreach($temp as $size){
                echo "<input type='text' value". $size.">";
                $ctr_size++;
                }
        }

please help..

Recommended Answers

All 2 Replies

Member Avatar for diafol

I'm assuming that you mean the result of your query. As we don't know the content of your $sizes variable, impossible to say if it will work or not.

In addition:

$ctr_size='';

should be:

$ctr_size=0;

However, it's not being used in your code, so I don't see the point of it.

I'm assuming this should be:

echo "<input type='text' value='" . $size. "'>";

Notice the equals sign and the addition of single quotes.

yeah I forgot those single qoutes!. :)

thnx for your help Sir diafol :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.