arrays Windows v.s Linux

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
georgeT
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Apr 03, 2017 3:57 pm

Fri Apr 14, 2017 11:45 am

It worked fine on windows but I need to run it under Linux and it just does not want to budge! Would anyone would have any idea what might be going on? Or, what would be conflicting between the two OSs. Thanks much. :help:

Code: Select all

	$result = mysql_query("SELECT location,comments,locid FROM $locationdb
			WHERE userid = '$userid'");
	if($result){
				echo"query failed_ ";
		mysql_close($conn);
		return $unprocessed;

	}else{
		while($draw = mysql_fetch_array($result)){
			$nlocs[$j]= $draw['location'];
			$nlocloc[$j]= $draw['comments'];
			$nlocid[$j]= $draw['locid'];
			$locArray[$nlocid[$j]] = $nlocloc[$j]." ~ ".$nlocs[$j];		// is this correct???
			$j++;
		}
		mysql_close($conn);
		return $locArray;
	}

This is the output I am trying to get:
// location, comment, id
// location = street xyz // comment = 9am, friday // id = user (multiple locations just this one user)
<option> street xyz, 9am, friday </option>
<option> street abc, 2pm, thursday </option>
<option> street opl, 12noon, friday </option>

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Sat Apr 15, 2017 9:43 am

You might find that the mysql functions have been removed ( deprecated since PHP 5.5 ) so it would probably need to be updated anyway to either MySQLi or PDO.

georgeT
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Apr 03, 2017 3:57 pm

Sun Apr 16, 2017 8:34 am

My PHP version is 5.3.3! Nigel, you talk about v5.5, is everybody up to date, what about the providers, if you want to setup a web site!? It seems like some of the stuff is moving too fast forcing unnecessary changes to existing apps. You know the saying; "the old worked and was reliable, the new is new, unreliable and does not last!"
I just need to figure out the workings around.
Thanks.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest