php-general Digest 9 Aug 2013 10:25:32 -0000 Issue 8327
Topics (messages 321817 through 321824):
Re: Operand error...
321817 by: Jim Giner
321818 by: Karl-Arne Gjersøyen
321819 by: Jim Giner
321820 by: Karl-Arne Gjersøyen
321821 by: Jim Giner
321822 by: Karl-Arne Gjersøyen
321823 by: Jim Giner
List problem again...
321824 by: Karl-Arne Gjersøyen
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_pa_valgt_lager;
result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/index.php* on line *2970
*I have also tried this:
$kg_pa_lager += $kg_fra_transportdokument_inn_pa_valgt_lager;
Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: "No
syntax error"
What am I doing wrong this time?
Thanks for your good advice!
Karl
You do a var_dump on each variable to see what type they were defined as.
--- End Message ---
--- Begin Message ---
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
> On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
>
>> $oppdater_lager_med_antall_kg = $kg_pa_lager +
>> $kg_fra_transportdokument_inn_**pa_valgt_lager;
>>
>>
>> result:
>> *Fatal error*: Unsupported operand types in *
>> /Users/karl/Sites/kasen/io/kp/**index.php* on line *2970
>>
>> *I have also tried this:
>>
>> $kg_pa_lager += $kg_fra_transportdokument_inn_**pa_valgt_lager;
>>
>> Both of them return this Fatal error.
>> I am using Dreamweaver CS6 and the syntax check in my software say: "No
>> syntax error"
>>
>> What am I doing wrong this time?
>>
>> Thanks for your good advice!
>>
>> Karl
>>
>> You do a var_dump on each variable to see what type they were defined as.
NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
--- End Message ---
--- Begin Message ---
On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_**pa_valgt_lager;
result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/**index.php* on line *2970
*I have also tried this:
$kg_pa_lager += $kg_fra_transportdokument_inn_**pa_valgt_lager;
Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: "No
syntax error"
What am I doing wrong this time?
Thanks for your good advice!
Karl
You do a var_dump on each variable to see what type they were defined as.
NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
That is one var. What is the other var?
--- End Message ---
--- Begin Message ---
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
> On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:
>
>> 2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
>>
>> On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
>>>
>>> $oppdater_lager_med_antall_kg = $kg_pa_lager +
>>>> $kg_fra_transportdokument_inn_****pa_valgt_lager;
>>>>
>>>>
>>>>
>>>> result:
>>>> *Fatal error*: Unsupported operand types in *
>>>> /Users/karl/Sites/kasen/io/kp/****index.php* on line *2970
>>>>
>>>>
>>>> *I have also tried this:
>>>>
>>>> $kg_pa_lager += $kg_fra_transportdokument_inn_****pa_valgt_lager;
>>>>
>>>>
>>>> Both of them return this Fatal error.
>>>> I am using Dreamweaver CS6 and the syntax check in my software say: "No
>>>> syntax error"
>>>>
>>>> What am I doing wrong this time?
>>>>
>>>> Thanks for your good advice!
>>>>
>>>> Karl
>>>>
>>>> You do a var_dump on each variable to see what type they were defined
>>>> as.
>>>>
>>>
>>
>> NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
>>
>> That is one var. What is the other var?
Thank you very much!
Now I know the error.. One of those variables are NULL! When I fix it I
think it work!
Karl
--- End Message ---
--- Begin Message ---
On 8/8/2013 1:56 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_****pa_valgt_lager;
result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/****index.php* on line *2970
*I have also tried this:
$kg_pa_lager += $kg_fra_transportdokument_inn_****pa_valgt_lager;
Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say: "No
syntax error"
What am I doing wrong this time?
Thanks for your good advice!
Karl
You do a var_dump on each variable to see what type they were defined
as.
NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
That is one var. What is the other var?
Thank you very much!
Now I know the error.. One of those variables are NULL! When I fix it I
think it work!
Karl
actually, the null is ok I think. The array is wrong - you can't 'add'
an array to a scalar variable, which an integer or null is.
--- End Message ---
--- Begin Message ---
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
> On 8/8/2013 1:56 PM, Karl-Arne Gjersøyen wrote:
>
>> 2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
>>
>> On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:
>>>
>>> 2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
>>>>
>>>> On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
>>>>
>>>>>
>>>>> $oppdater_lager_med_antall_kg = $kg_pa_lager +
>>>>>
>>>>>> $kg_fra_transportdokument_inn_******pa_valgt_lager;
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> result:
>>>>>> *Fatal error*: Unsupported operand types in *
>>>>>> /Users/karl/Sites/kasen/io/kp/******index.php* on line *2970
>>>>>>
>>>>>>
>>>>>>
>>>>>> *I have also tried this:
>>>>>>
>>>>>> $kg_pa_lager += $kg_fra_transportdokument_inn_******pa_valgt_lager;
>>>>>>
>>>>>>
>>>>>>
>>>>>> Both of them return this Fatal error.
>>>>>> I am using Dreamweaver CS6 and the syntax check in my software say:
>>>>>> "No
>>>>>> syntax error"
>>>>>>
>>>>>> What am I doing wrong this time?
>>>>>>
>>>>>> Thanks for your good advice!
>>>>>>
>>>>>> Karl
>>>>>>
>>>>>> You do a var_dump on each variable to see what type they were
>>>>>> defined
>>>>>> as.
>>>>>>
>>>>>>
>>>>>
>>>> NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
>>>>
>>>> That is one var. What is the other var?
>>>>
>>>
>>
>> Thank you very much!
>> Now I know the error.. One of those variables are NULL! When I fix it I
>> think it work!
>>
>> Karl
>>
>> actually, the null is ok I think. The array is wrong - you can't 'add'
> an array to a scalar variable, which an integer or null is.
Yes, it is me and arrays again :D
$resultat = mysql_query($sql, $tilkobling) or die(mysql_error());
$antall = mysql_num_rows($resultat);
for($i = 0; $i < $antall; $i++){
$rad = mysql_fetch_array($resultat, MYSQL_ASSOC);
and write it tis way can perhaps make someting more correct?
For example $variable[$i] ?
Karl
--- End Message ---
--- Begin Message ---
On 8/8/2013 2:11 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:56 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:43 PM, Karl-Arne Gjersøyen wrote:
2013/8/8 Jim Giner <jim.gi...@albanyhandball.com>
On 8/8/2013 1:32 PM, Karl-Arne Gjersøyen wrote:
$oppdater_lager_med_antall_kg = $kg_pa_lager +
$kg_fra_transportdokument_inn_******pa_valgt_lager;
result:
*Fatal error*: Unsupported operand types in *
/Users/karl/Sites/kasen/io/kp/******index.php* on line *2970
*I have also tried this:
$kg_pa_lager += $kg_fra_transportdokument_inn_******pa_valgt_lager;
Both of them return this Fatal error.
I am using Dreamweaver CS6 and the syntax check in my software say:
"No
syntax error"
What am I doing wrong this time?
Thanks for your good advice!
Karl
You do a var_dump on each variable to see what type they were
defined
as.
NULL array(2) { [0]=> string(3) "100" [1]=> string(3) "340" }
That is one var. What is the other var?
Thank you very much!
Now I know the error.. One of those variables are NULL! When I fix it I
think it work!
Karl
actually, the null is ok I think. The array is wrong - you can't 'add'
an array to a scalar variable, which an integer or null is.
Yes, it is me and arrays again :D
$resultat = mysql_query($sql, $tilkobling) or die(mysql_error());
$antall = mysql_num_rows($resultat);
for($i = 0; $i < $antall; $i++){
$rad = mysql_fetch_array($resultat, MYSQL_ASSOC);
and write it tis way can perhaps make someting more correct?
For example $variable[$i] ?
Karl
Not sure what your question is now. But - $rad will contain a single
row of values here, all in an array such as
$rad['field_name1'],$rad['field_name2'],$rad['field_name3'],.... .
--- End Message ---
--- Begin Message ---
In my HTML5/PHP form I have this two rows..
<tr> <td align="left" valign="top">0082</td> <td align="left"
valign="top">Exan E</td> <td align="left"
valign="top">LEXE25NO</td> <td align="left" valign="top">200</td>
<td align="center" valign="top"> <input type="hidden"
name="leverandor" value="Orica"> <input type="hidden"
name="valgt_lager" value="Sviland"> <input type="hidden"
name="un_nr" value="0082"> <input type="hidden" name="varenavn"
value="Exan E"> <input type="hidden" name="varenr[]"
value="LEXE25NO"> <input type="hidden" name="adr_vekt_kg[]"
value="200"> <input type="checkbox" name="varenr_inn_pa_lager[]"
value="LEXE25NO"> </td></tr><tr> <td align="left"
valign="top">0081</td> <td align="left" valign="top">Dynamit -
papirpatron - 22x180</td> <td align="left"
valign="top">EDY22X180K</td> <td align="left" valign="top">100</td>
<td align="center" valign="top"> <input type="hidden"
name="leverandor" value=""> <input type="hidden" name="valgt_lager"
value="Sviland"> <input type="hidden" name="un_nr" value="0081">
<input type="hidden" name="varenavn" value="Dynamit - papirpatron -
22x180"> <input type="hidden" name="varenr[]"
value="EDY22X180K"> <input type="hidden" name="adr_vekt_kg[]"
value="100"> <input type="checkbox" name="varenr_inn_pa_lager[]"
value="EDY22X180K"> </td></tr>
Then I have this in PHP source to handle it...
$antall_varenr = count($varenr_inn_pa_lager);
$i = 0;
if($i < $antall_varenr){
foreach($varenr_inn_pa_lager as $vnr){
echo "$vnr<br />";
}
}
++$i;
This source code get the serialnumber ($varenr_inn_pa_lager).
The problem I struggling with is that it is two different products.
The product with serialnumber "LEXE25NO" is named Exan and the other
product with serialnumber "EDY22X180K" is Dynamite.
I need a way to extract products and put them into their own table.
The database have one table for Exan and another table for Dynamite,
and I recive products for both at the same time. I do not know where
to start for put product in their own table knowing by their own
serialnumber.
I think this is a list problem but need some help to understand this stuff.
Thank you very much. I am very thankful for all your help.
Karl
--- End Message ---