[Solved] SQL Error message: [closed]

Hard to guess without as much details as needed, but i think you are escaping the values with aphostropes (‘). That’s php’s habit. MySQL doesn’t escape those values with aphostropes, it uses backtiks (`) or nothing. You could change your query part which you provided to remove those symbols: … 2013-12-10, NULL, dsffsd, dfsfsd, sfdd, … Read more

[Solved] filenames to mysql database [closed]

Use PHP glob() function to get all files from a folder $files = glob(directory_path.”/*”); // get all files in a folder // Loop through array of fetched files and insert into database. foreach ($files as $file) { $filename = basename($file); // WRITE YOU MySQL code here that inserts filenames into DB } MySQL Insert 0 … Read more

[Solved] split string with preg_split [closed]

You can try this $lines = array(); $lines = explode(“2013”,$string); foreach($lines as $key => $value) { $data = array() $data = explode(“;;”,$value); $lines[$key][‘data’] = $data } solved split string with preg_split [closed]

[Solved] converting html to image not working [closed]

You have unwanted chars before <?. remove all blank lines and spaces before <? your image is otherwise correct. <? must be the first character first line in your script. you can avoid ?> if you use it it must be the last line last chars. solved converting html to image not working [closed]

[Solved] Parse a string in php

Use PHP’s pathinfo() function: http://php.net/manual/en/function.pathinfo.php $info = pathinfo(‘items/category/test.txt’); $dirPath = $info[‘dirname’]; // OR $dirPath = pathinfo(‘items/category/test.txt’, PATHINFO_DIRNAME); // Output: items/category solved Parse a string in php

[Solved] ie8 with anchor causes crash [closed]

The problem is the href: assortiment.php#top is asking too much. IE8 can’t deal with a link to an element that doesn’t exist yet (the relative anchor is linking to an element on the new page). JS can solve this problem for you, though: window.onload = function() { if (location.href.indexOf(‘#top’) === -1) { location.href += ‘#top’; … Read more

[Solved] Using mysql query and result in php? [closed]

Your query looks fine. Use these statements to execute the query and get the count: $result = mysql_query($myquery); $rowCount = mysql_num_rows($result); If($rowCount !=0){ echo “NOT EMPTY”; }else{ echo “EMPTY”; } To FREE up the result: mysql_free_result($result); 2 solved Using mysql query and result in php? [closed]

[Solved] How to randomly select characters from string using PHP? [closed]

All you need is $str = “abab cdcd efef”; $list = array_map(function ($v) { $v = str_split($v); shuffle($v); return implode(current(array_chunk($v, 2))); }, explode(” “, $str)); echo “<pre>”; print_r($list); Output Array ( [0] => ab [1] => cd [2] => ef ) Simple Online Demo 1 solved How to randomly select characters from string using PHP? … Read more

[Solved] Create top ten list of items in php [closed]

To do this, first you must get the movies from the database and list them. For example, a simple select-query that selects all the movies and shows them to the user using a while-loop. $get_movies = mysqli_query(“SELECT * FROM `movies`”); while($row_movies = mysql_fetch_array($get_movies);) { echo $row_movies[‘title’]; } You then allow the user to rate the … Read more

[Solved] pagination for custom PHP site [closed]

It all depends on where and how your pages are stored though! if you do that with a database, you would need to check if the $pagenum ( which we don’t see defined anywhere ) has previous/next pages… and based on that you draw you +/- 5 pages anchors! preferably doing some looping! On the … Read more

[Solved] MYSQL: Search for User ID in one table to search for data in 2 other tables, then show data from all 3 tables

SELECT * FROM section_user_map JOIN users USING (UID) JOIN verification USING (UID) WHERE SectionID = 65 AND CompleteDate BETWEEN ‘2012-05-09 12:00:00’ AND ‘2012-05-11 12:00:00’ See it on sqlfiddle. No UNION required. Outer join would only be required if you still want to return results for users who do not exist in one (or both) of … Read more

[Solved] How to create json response

Try mysql_fetch_assoc: $json = array(); while ($row = mysql_fetch_assoc($result)) { $json[$row[‘uid’]] = array( ‘lat’ => $row[‘lat’], ‘lon’ => $row[‘lon’], ‘loc’ => $row[‘loc’] ); } echo json_encode($json); You should use MySQLi or PDO_MySQL instead of mysql_. 1 solved How to create json response

[Solved] Multiple image upload using php [closed]

Mike here is a rough solution, I will not write the entire code here but I will explain the logic behind it. You have 2 ways to go , one would be to name each and every field manually (which would mean that you are limited to the number of fields you add manually) or … Read more