182x
-
Posts
179 -
Joined
-
Last visited
Never
Posts posted by 182x
-
-
Still getting the same syntax error seems to be with this part of the code
WHERE techId= $temp['Id']";
any ideas?
-
hey guys,
just wondering where I went wrong with this syntax?
Thanks
$get= "SELECT * FROM use WHERE Id = $Id AND acc= $acc"; $query= mysql_query($get, $link_id) or die(mysql_error()); $temp=mysql_fetch_array($query) $del="DELETE FROM tech WHERE techId= $temp['Id']"; $mysql_query($del, $link_id)or die(mysql_error());
-
Hey guys just wondering where I went wrong? Thanks.
$del="DELETE FROM tr, ts WHERE tr.Id = $Id AND ts.user = tr.user";
-
Here it is.
$test=select * from tableA, tableB where tableAId = tableBId; $query=mysql_query($test, $link_id) or die(mysql_error()); while($get=mysql_fetch_array($query)) { echo "<tr class='style4'><td>".$query['tableA.ds']."</td><td>".$query['tableB.hy']."</td></tr>"; }
-
I think i got the join working but how is this data displayed in a table for example in the code below i don't think the array elements can be accessed like tableA.ds and tableB.hy
while($s1=mysql_fetch_array($query1)) { $s2=mysql_fetch_array($query2); echo "<tr class='style4'><td>".$s1['ds']."</td><td>".$s2['hy']."</td></tr>"; }
-
Hey guys,
In order to display data from sql queries in a table I have had to create two different queries and then put the results into different arrays so this can be achieved as when I preform a join query it does not seem to work.
I was just wondering can this be achieved with queries which make use of more than one table or are two different arrays the only way to go?
thanks.
example:
while($s1=mysql_fetch_array($query1)) { $s2=mysql_fetch_array($query2); echo "<tr class='style4'><td>".$s1['ds']."</td><td>".$s2['hy']."</td></tr>"; }
-
Thanks, so it won't matter that the temp column is not in both database tables?
-
Hey guys,
I have two database tables which both have information I am displaying in a html table, however one of these database tables has an additional field called 'temp' so I was wondering what is the best way to decide if temp can be shown or not as it only appears in only one of the database tables but the column temp has to appear in the html table?
I am not at a machine where I can currently test this so i was also wondering if this code will work?
if (empty($st['temp])) { $temp = "<td>No entry</td>"; } else { $temp = "<td>$display['path']</td>"; }
-
Can you post your most recent code?
Also what kind of paths are being stored? Is it an absolute path or a relative path?
Hi Its a relative path, it seems to be a permission error not sure how to fix this in vista and I have ensured the folder has all te necessary access rights.
-
I still can't figure this one out. Is there a chance that getting the variable from the array is wrong in terms of syntax?
-
Thats the weird thing everything seems right.
-
yeah thats weird though, when I check the database with phpmyadmin it indicates that the information is there.
-
Just gave it a try nothing was displayed
-
Thanks, It still doesn't remove the file just removes the database record as before. Anymore suggestions?
-
Thanks for the replies, It does remove the record from the database just not the file.
How do I print out the name as it is in an array, I tried using echo but I kept getting syntax errors.
-
Hey guys, the following code removes a record from the database but it wont remove the file related to the record which is obtained form the fileLocation field which is a path such as ../files/test.doc. I was just wondering how to fix this? Thanks.
$del="SELECT fileLocation FROM em WHERE emp = $pr"; $re = mysql_query($de, $link_id)or die(mysql_error()); $g=mysql_fetch_array($re); if (empty($g)) { $de="DELETE FROM em WHERE emp = $pr; $re= mysql_query($de, $link_id)or die(mysql_error()); } else{ $de="DELETE FROM em WHERE emp = $pr"; $re = mysql_query($de, $link_id)or die(mysql_error()); unlink($g); }
-
-
Hey guys in the following code structure would the ELSE only apply to the second IF statement or is there any change it could be affected by the first IF?
Structure IF ... IF ... ELSE .... IF
-
DOH! I was looking at that for ages and didn't even notice. Thanks!
-
hey guys the following code is giving me this error:
Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\a\te.php on line 62
just wondering whats up with it? Thanks.
$ge= "SELECT * FROM t WHERE em= $pro"; $qu= mysql_query($ge, $link_id) or die(mysql_error()); if (mysql_num_rows($qu==0 ) { $st=mysql_fetch_array($qu); $st="INSERT INTO ta VALUES ('','','{$st['emp']}','{$st['te']}', '{$st['y']}','{$storeInfo2['up']}','{$st['up']}')"; $r = mysql_query($st, $link_id)or die(mysql_error()); }
-
Hey guys,
I have made a small page where users can upload files and then download them from another, however if there is a space in the filename the download will not work properly. I was just wondering if thats how things are or if there is a way round this?
Thanks.
-
Hey guys,
Just wondering what is wrong with the following syntax, I was also wondering id there a way to split the insert statement so it can appear over multiple lines?
Thanks
$st=mysql_fetch_array($query2) $sto="INSERT INTO em VALUES ('','$st['1]','$st['2']','$st['2']','$st['2']','$st['2']','$st['2']','$st['2']','$st['2']')";
error: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\a\t\te.php on line 55
-
echo "<option value = '".$r['Id']."'>".$r['Id']."</option>\n";
i havent a clue what that might do to help, but i know that if i sometimes rewrite my code again, the error disapears.... its really weird
You were right that fixed it. Thanks
-
could be an issue with the field type. Is the field Char or Int
The type is varchar, does that make a difference. I pretty new to all this.
variable name question
in PHP Coding Help
Posted
Hey guys, just wondering is there a limit to the size of variable names? I am using the name 'employeeTechProblemId' for the field in a database but I keep getting the following error. However the variable name is correct.
Unknown column 'employeeTechProblemId' in 'where clause'