PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
When it loads on the net server it just makes a blank page, it works locally.... if i do the same but not in an array it works....
Anyone got any ideas?
if it is a completely blank page (even when opening the browser's sourceview) then it's most likely a parse error.
But maybe a bit more debug-output can help
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /files/home/wildtangent/arraytest.php on line 14
Notice: Undefined variable: cells in /files/home/wildtangent/arraytest.php on line 22
Notice: Undefined variable: table in /files/home/wildtangent/arraytest.php on line 37
SELECT tblprojects.projectid, tblprojects.projectname, tblprojects.projecticon, tblprojects.projecttext, tblservicedata.servicedataid, tblprojectassociations.projectassociationid, tblprojectassociations.projectid, tblprojectassociations.servicetypeid FROM tblprojects INNER JOIN (tblprojectassociations INNER JOIN tblservicedata ON tblprojectassociations.servicetypeid=tblservicedata.servicedataid) ON tblprojectassociations.projectid=tblprojects.projectid GROUP BY tblprojects.projectid
Functionality added or changed:
[...]
Allow braces in joins in all positions. Formerly, things like SELECT * FROM (t2 LEFT JOIN t3 USING (a)), t1 worked, but not SELECT * FROM t1, (t2 LEFT JOIN t3 USING (a)). Note that braces are simply removed, they do not change the way the join is executed.
hm, my knowledge of sql is really limited. It's sufficient to create my own querries but I often fail to see why someone tries to do this or that. Could you please explain
FROM tblprojects INNER JOIN (tblprojectassociations INNER JOIN tblservicedata ON tblprojectassociations.servicetypeid=tblservicedata.servicedataid) ON tblprojectassociations.projectid=tblprojects.projectid
to me? esp. the part with the brackets and why you've used them there?
If the above is true and bracktes are simply removed you have something like "ON conditionA ON conditionB which is not a valid join-condition (afaik). Is it supposed to be some kind of subquery?
Basically it selects all producs and their information from the product table along with which services they are listed under (they can be more than one type of serve) and the corresponding service information.
It doesnt make a difference if i remove the quotes and try to rearrange it.
The SQL is right, but it just doesnt pull the data off. but the database does exist and the data is filled in. It also pulls off all the data individually.
if(substr(mysql_get_server_info(), 0, 1) == '4'){
$sql = '...one that works in version 4 here...';
}else{
$sql = '...one that works in version 3 here...';
}
EXPLAIN SELECT tblprojects.projectid, tblprojects.projectname, tblprojects.projecticon, tblprojects.projecttext, tblservicedata.servicedataid, tblprojectassociations.projectassociationid, tblprojectassociations.projectid, tblprojectassociations.servicetypeid FROM tblprojects INNER JOIN (tblprojectassociations INNER JOIN tblservicedata ON tblprojectassociations.servicetypeid=tblservicedata.servicedataid) ON tblprojectassociations.projectid=tblprojects.projectid GROUP BY tblprojects.projectid
returns
Impossible WHERE noticed after reading const tables
which usually is a sign for an invalid/nonsense query.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /files/home/wildtangent/arraytest.php on line 14
Notice: Undefined variable: cells in /files/home/wildtangent/arraytest.php on line 22
Notice: Undefined variable: table in /files/home/wildtangent/arraytest.php on line 37