Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Uninitialized string offset: 0
Old 10-27-2010, 12:30 PM Uninitialized string offset: 0
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
hello, please i need some help, I dont know what im doing wrong here. I keep getting this error and yesterday i wasn't getting it if anyone knows please help, thank you very much. the error is on line 561


PHP Code:
function CustomExpression($value,$data,$field,$table="")
{
    global 
$strTableName;
    if(!
$table)
        
$table=$strTableName;
    if(
$table=="Edrs Activos" && $field=="health_letter"
    {
                                
$value="";
                
$msql1 "select `Case #` from `Vital Info` where `Case #` = '".$data['Case #']."'";
                
$nsql1 mysql_query($msql1) or die(mysql_error());
                
$mmsql1 mysql_fetch_assoc($nsql1);
                
$values $mmsql1['Case #'];
                
$msql "SELECT `Tipo de Servicio` FROM `Vital Info` WHERE `Case #` = '".$data['Case #']."'";
                
$nsql mysql_query($msql) or die(mysql_error());
                
$mmsql mysql_fetch_assoc($nsql);
                
$data $mmsql['Tipo de Servicio'];
                
$msql2 "select `health_letter` from `Edrs Activos` where `Case #` = '".$data['Case #']."'"//LINE 561
                
$nsql2 mysql_query($msql2) or die(mysql_error());
                
$mmsql2 mysql_fetch_assoc($nsql2);
                
$done $mmsql2['health_letter'];
                                            
//$value = GetData($data,"health_letter", "");
                
            
if ($data == "Traslado Guatemala")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>Incomplete</font></a>";
            else if (
$data == "Traslado Salvador/Honduras/Nicaragua")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>Incomplete</font></a>";
            else if (
$data == "")
                
$value "<strong><font color='green'>Check Vital Info</font>";
            else if (
$done == "Done")
                
$value "<a href=\"health_letter_view.php?editid1=" .$values"\" target=_blank>Done!</a>";
            else if (
$done == "Pending")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>En Proceso</font></a>";
            else
                
$value "N/A";
            
$record["health_letter_value"]=$value;
    } 
stivens is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-27-2010, 12:43 PM Re: Uninitialized string offset: 0
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
There aren't 561 lines of code there. Which one is 561?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-27-2010, 12:44 PM Re: Uninitialized string offset: 0
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
I marked the line 561 there

$msql2 = "select `health_letter` from `Edrs Activos` where `Case #` = '".$data['Case #']."'"; //LINE 561
stivens is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 12:55 PM Re: Uninitialized string offset: 0
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I'm guessing the problem occurs right before the line in question:
PHP Code:
$data $mmsql['Tipo de Servicio']; 
Did you mean to overwrite $data? What is it set to after this line?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-27-2010, 01:19 PM Re: Uninitialized string offset: 0
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
yes thank you very much it solved the error its not showing up anymore, i changed the variable name to $info but im trying to call the data here $done ant its suppose to display "Done" but its not working,

PHP Code:
function CustomExpression($value,$data,$field,$table="")
{
    global 
$strTableName;
    if(!
$table)
        
$table=$strTableName;
    if(
$table=="Edrs Activos" && $field=="health_letter"
    {
                                
$value="";
                
$msql1 "select `Case #` from `Vital Info` where `Case #` = '".$data['Case #']."'";
                
$nsql1 mysql_query($msql1) or die(mysql_error());
                
$mmsql1 mysql_fetch_assoc($nsql1);
                
$values $mmsql1['Case #'];
                
$msql2 "select `health_letter` from `Edrs Activos` where `Case #` = '".$data['Case #']."'";
                
$nsql2 mysql_query($msql2) or die(mysql_error());
                
$mmsql2 mysql_fetch_assoc($nsql2);
                
$done $mmsql2['health_letter'];
                
$msql "SELECT `Tipo de Servicio` FROM `Vital Info` WHERE `Case #` = '".$data['Case #']."'";
                
$nsql mysql_query($msql) or die(mysql_error());
                
$mmsql mysql_fetch_assoc($nsql);
                
$info $mmsql['Tipo de Servicio'];
                                            
//$value = GetData($data,"health_letter", "");
                
            
if ($info == "Traslado Guatemala")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>Incomplete</font></a>";
            else if (
$info == "Traslado Salvador/Honduras/Nicaragua")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>Incomplete</font></a>";
            else if (
$info == "")
                
$value "<strong><font color='green'>Check Vital Info</font>";
            else if (
$done == "Done")
                
$value "<a href=\"health_letter_view.php?editid1=" .$values"\" target=_blank>Done!</a>";
            else if (
$done == "Pending")
                
$value "<a href=\"health_letter_edit.php?editid1=" .$values"\" target=_blank><strong><font color='red'>En Proceso</font></a>";
            else
                
$value "N/A";
            
$record["health_letter_value"]=$value;;
    } 
stivens is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 01:23 PM Re: Uninitialized string offset: 0
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
What exactly do you mean by 'its not working'. What is the value of $done after
PHP Code:
$done $mmsql2['health_letter']; 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-27-2010, 01:37 PM Re: Uninitialized string offset: 0
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
the value of $done is the value that is in the 'health_letter' field on the table `Edrs Activos` which theres only two options "Done" or "Pending" if the value is "Done" it should display "Done" with a link, if the value is "Pending" it should display "En Proceso" with a link, but its displaying "Incomplete" which is right too cause is displaying $info == "Traslado Guatemala". but i was hoping that even when $info is true $done takes priority because im doing the exact same thing in other table and its working fine.
stivens is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 02:13 PM Re: Uninitialized string offset: 0
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
If you want $done to 'take priority' you should check it before checking $info.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 10-28-2010, 12:10 PM Re: Uninitialized string offset: 0
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
of course! that makes a lot of sense.. thank you very much! problem solved.
stivens is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Uninitialized string offset: 0
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30840 seconds with 12 queries