php - Parse error: syntax error, unexpected T_VARIABLE on line 110 -
I am trying to get the user ID from the user database which is the data user name I have from the session so To select the name, the ID is stored in the id and it is trusted
The code I have is that it stores the uploaded image string but users only have permission to upload the image. When the image is loaded, I want to store the user id with the string in the photo table with the string, to know which user has added the photo
// setting veraables $ imagestring = $ _FILES ["file"] ["name"]; $ Filetype = $ _FILES ["file"] ["type"]; $ Session name = $ _SESSION ['username']; $ Description = $ _POST ['desc']; // user id $ myquery = mysql_query ("Select user id where username = '$ sessionusername'"); $ Line = mysql_fetch_array ($ query); // Dosage mysql_connect ("$ host", "$ username", "$ password") insert or die ("can not connect"); Mysql_select_db ("$ db_name") or die ("can not choose DB"); $ Sql = 'INSERT INTO'. $ Tbl_name '(Photographer ID, Photodose, PhotoString) Value (' $ line ',' $ description ', "k001388.atpace.eu/photoalbum/upload/'imimestring.''filetype.' '') '; $ Result = mysql_query ($ Sql);
You can forget the dots: < Pre> $ Sql = 'INSERT INTO'. $ Tbl_name. '(Photographer id, photoodet, photostring) value (' $ line ',' $ description ', "k001388.atpace.eu/photoalbum/upload/'.imigestring '.' Filetype. '' ')'; Perhaps should be:
$ sql = 'INSERT INTO'. $ Tbl_name '(Photographer ID, Photodesk, PhotoString) value ("'. $ Line. '', ''. $ Description. '', '' K00138899.atspace.eu/photoalbum/upload/'$imagestring.'.'filetype '' ") ';
Comments
Post a Comment