The original SimCity is now the open source Micropolis
Thu, 31 Jan 2008 19:00:00 GMT
Think you're smarter than the meatheads on your local city council? Now you can prove it -- without running for office -- courtesy of the original city simulation game. Electronic Arts (EA) has released the source code to SimCity under the GPLv3. The newly freed game is dubbed Micropolis, and it is playable in most major Linux distributions.
Hi everyone,
I know the following questions are noobish questions but I am asking them because I am confused about the basics of history behind UNIX and LINUX.
Ok onto business, my questions are-:
Was/Is UNIX ever an open source operating system ?
If UNIX was... (21 Replies)
Hi Friends
I'm new to this UNIX - I'm working on the porting project from Solaris To Linux i just want to map some commands from solaris to Linux so can any one please tell me how to get the source code of the commands like "ls", "cu", "du"
Regards
sabee (1 Reply)
MAXDB_REAL_ESCAPE_STRING(3) 1 MAXDB_REAL_ESCAPE_STRING(3)maxdb_real_escape_string - Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the con-nection
Procedural style
SYNOPSIS
string maxdb_real_escape_string (resource $link, string $escapestr)
DESCRIPTION
Object oriented style
string maxdb::real_escape_string (string $escapestr)
This function is used to create a legal SQL string that you can use in an SQL statement. The string escapestr is encoded to an escaped SQL
string, taking into account the current character set of the connection.
Characters encoded are ', ".
RETURN VALUES
Returns an escaped string.
EXAMPLES
Example #1
Object oriented style
<?php
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city");
$city = "'s Hertogenbosch";
/* this query will fail, cause we didn't escape $city */
if (!$maxdb->query("INSERT into temp.mycity VALUES ('11111','$city','NY')")) {
printf("Error: %s
", $maxdb->sqlstate);
}
$city = $maxdb->real_escape_string($city);
/* this query with escaped $city will work */
if ($maxdb->query("INSERT into temp.mycity VALUES ('22222','$city','NY')")) {
printf("%d Row inserted.
", $maxdb->affected_rows);
}
$maxdb->close();
?>
Example #2
Procedural style
<?php
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
maxdb_query($link, "CREATE TABLE temp.mycity LIKE hotel.city");
$city = "'s Hertogenbosch";
/* this query will fail, cause we didn't escape $city */
if (!maxdb_query($link, "INSERT into temp.mycity VALUES ('11111','$city','NY')")) {
printf("Error: %s
", maxdb_sqlstate($link));
}
$city = maxdb_real_escape_string($link, $city);
/* this query with escaped $city will work */
if (maxdb_query($link, "INSERT into temp.mycity VALUES ('22222','$city','NY')")) {
printf("%d Row inserted.
", maxdb_affected_rows($link));
}
maxdb_close($link);
?>
The above example will output something similar to:
Warning: maxdb_query(): -5016POS(43) Missing delimiter: ) <...>
Error: 42000
1 Row inserted.
SEE ALSO maxdb_character_set_name(3).
PHP Documentation Group MAXDB_REAL_ESCAPE_STRING(3)