php – Euclides http://ezisetup.com/designs/euclides Just another EziSite Sun, 14 Dec 2014 06:09:45 +0000 en-US hourly 1 MySQL Dump http://ezisetup.com/designs/euclides/mysql-dump/ http://ezisetup.com/designs/euclides/mysql-dump/#respond Fri, 21 Jan 2011 12:25:14 +0000 http://www.cssigniter.com/preview/euclides/?p=7 Description

Just use the following code. Praesent eget neque eu eros interdum malesuada non vel leo. Sed fringilla porta ligula egestas tincidunt. Nullam risus magna, ornare vitae varius eget, scelerisque a libero. Morbi eu porttitor ipsum. Nullam lorem nisi, posuere quis volutpat eget, luctus nec massa. Pellentesque aliquam lacinia tellus sit amet bibendum. Ut posuere justo in enim pretium scelerisque. Etiam ornare vehicula euismod. Vestibulum at risus augue. Sed non semper dolor. Sed fringilla consequat velit a porta. Pellentesque sed lectus pharetra ipsum ultricies commodo non sit amet velit. Suspendisse volutpat lobortis ipsum, in scelerisque nisi iaculis a. Duis pulvinar lacinia commodo.

The code

[php]
if (!function_exists(‘mysql_dump’)) {

function mysql_dump($database) {

$query = ”;

$tables = @mysql_list_tables($database);
while ($row = @mysql_fetch_row($tables)) { $table_list[] = $row[0]; }

for ($i = 0; $i < @count($table_list); $i++) { $results = mysql_query('DESCRIBE ' . $database . '.' . $table_list[$i]); $query .= 'DROP TABLE IF EXISTS `' . $database . '.' . $table_list[$i] . '`;' . lnbr; $query .= lnbr . 'CREATE TABLE `' . $database . '.' . $table_list[$i] . '` (' . lnbr; $tmp = ''; while ($row = @mysql_fetch_assoc($results)) { $query .= '`' . $row['Field'] . '` ' . $row['Type']; if ($row['Null'] != 'YES') { $query .= ' NOT NULL'; } if ($row['Default'] != '') { $query .= ' DEFAULT '' . $row['Default'] . '''; } if ($row['Extra']) { $query .= ' ' . strtoupper($row['Extra']); } if ($row['Key'] == 'PRI') { $tmp = 'primary key(' . $row['Field'] . ')'; } $query .= ','. lnbr; } $query .= $tmp . lnbr . ');' . str_repeat(lnbr, 2); $results = mysql_query('SELECT * FROM ' . $database . '.' . $table_list[$i]); while ($row = @mysql_fetch_assoc($results)) { $query .= 'INSERT INTO `' . $database . '.' . $table_list[$i] .'` ('; $data = Array(); while (list($key, $value) = @each($row)) { $data['keys'][] = $key; $data['values'][] = addslashes($value); } $query .= join($data['keys'], ', ') . ')' . lnbr . 'VALUES ('' . join($data['values'], '', '') . '');' . lnbr; } $query .= str_repeat(lnbr, 2); } return $query; } } [/php]

]]>
http://ezisetup.com/designs/euclides/mysql-dump/feed/ 0
EziSites Content From Separate Page Without ID http://ezisetup.com/designs/euclides/wordpress-content-from-separate-page-without-id/ http://ezisetup.com/designs/euclides/wordpress-content-from-separate-page-without-id/#comments Fri, 21 Jan 2011 13:53:58 +0000 http://www.cssigniter.com/preview/euclides/?p=43 Nulla fringilla, orci ac euismod semper, magna diam porttitor mauris, quis sollicitudin sapien justo in libero. Vestibulum mollis mauris enim. Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam.Nulla fringilla, orci ac euismod semper, magna diam porttitor mauris, quis sollicitudin sapien justo in libero. Vestibulum mollis mauris enim. Morbi euismod magna ac lorem rutrum elementum. Donec viverra auctor lobortis. Pellentesque eu est a nulla placerat dignissim. Morbi a enim in magna semper bibendum. Etiam scelerisque, nunc ac egestas consequat, odio nibh euismod nulla, eget auctor orci nibh vel nisi. Aliquam.

[php]

//PERFORMS MYSQL QUERY TO GET THE POST ID
//note: ‘about’ is the name of the page, you can use any named, ex: ‘web services’
$about_page_id = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_name = ‘about'”);

$post_id = get_post($about_id);
$content = $post_id->post_content;

//applies wordpress filter (includes

tags)
$content = apply_filters(‘the_content’, $content);

$content = str_replace(‘]]>’, ‘]]>’, $content);

echo $content;
?>
[/php]

]]>
http://ezisetup.com/designs/euclides/wordpress-content-from-separate-page-without-id/feed/ 6