showfields.php

October 6, 2011
<HTML><HEAD><TITLE>SHOW TABLES</TITLE></HEAD><BODY>
<?php
mysql_connect("localhost", "root", "phpxphp") or die(mysql_error());
$q1 = mysql_query("show databases;");
$n1 = mysql_num_rows($q1);
echo "<UL>\n";
for ($i=0; $i < $n1; $i++) {
    $r1 = mysql_result($q1, $i);
    echo "<LI>".$r1."</LI>\n";
    $q2 = mysql_query("show tables from $r1;");
    $n2 = mysql_num_rows($q2);
    echo "<UL>\n";
    for ($j = 0; $j < $n2; $j++) {
    	$r2 = mysql_result($q2, $j);
    	echo "\t<LI>".$r2."</LI>\n";
    	$q3 = mysql_query("show fields from $r2 from $r1;");
		$n3 = mysql_num_rows($q3);
		echo "<UL>\n";
		for ($k = 0; $k < $n3; $k++) {
			$r3 = mysql_result($q3, $k);
			echo "\t\t<LI>".$r3."</LI>\n";
			}
		echo "</UL>\n";
		}
	echo "</UL>\n";
	}
echo "</UL>\n";
mysql_close();
?>
</BODY></HTML>

showtables.php

September 1, 2011
<HTML><HEAD><TITLE>SHOW TABLES</TITLE></HEAD><BODY>
<?php
echo "SERVER DOCUMENT_ROOT: ".$_SERVER['DOCUMENT_ROOT']."<BR>\n";
//echo phpinfo(INFO_GENERAL)."\n";
echo "SERVER PHP_SELF: ".$_SERVER['PHP_SELF']."<BR>\n";
echo "SERVER SCRIPT_URI: ".$_SERVER['SCRIPT_URI']."<BR>\n";
echo "SERVER HTTP_GET_VARS: ".$_SERVER['HTTP_GET_VARS']."<BR>\n";

//echo "ENV PHPRC: ".$_ENV['PHPRC']."<BR>\n";
//echo "SERVER PHPRC: ".$_SERVER['PHPRC']."<BR>\n\n";
mysql_connect("localhost", "root", "phpxphp") or die(mysql_error());
$sd = mysql_query("show databases;");
$mnrsd = mysql_num_rows($sd);
echo "<UL>\n";
for ($i=0; $i < $mnrsd; $i++) {
    $theDatabase = mysql_result($sd, $i);
    echo "<LI>".$theDatabase."</LI>\n";
    $st = mysql_query("show tables from $theDatabase;");
    $mnrst = mysql_num_rows($st);
    echo "<UL>";
    mysql_select_db($theDatabase);
    for ($j = 0; $j < $mnrst; $j++) {
    	$theTable = mysql_result($st, $j);
    	$numRecs = mysql_num_rows(mysql_query("SELECT * FROM $theTable"));
    	//echo "\t<LI>".$theTable." - ".$numRecs."</LI>\n";
    	echo "\t<LI>".$theTable." (".$numRecs.")</LI>\n";
    	}
    echo "</UL>\n";
	}
echo "</UL>\n";
mysql_close();
?>
</BODY></HTML>

mysql_query.php

September 1, 2011
<HTML>
<HEAD>
   <TITLE><?echo $title?></TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#CCCCCC" LINK="#0000FF" VLINK="#660099" ALINK="#0000FF">
<H1 ALIGN=CENTER COLOR="#330099">Testing 2 PHP/MySQL</H1>

<?php
$link = mysql_connect('localhost', 'root', "phpxphp") or die('Could not connect: ' . mysql_error());
echo "MySQL Connect successfull!<br>";
$result = mysql_query("SELECT SESSION_USER(), CURRENT_USER();");
$row = mysql_fetch_row($result);
echo "SESSION USER: ", $row[0], "<br>";
echo "CURRENT USER: ", $row[1], "<br>";
echo "MySQL Get Client Info = ";
echo mysql_get_client_info();
mysql_close($link);
?>
</BODY>
</HTML>

mysql_connect.php

September 1, 2011
<?php
$title = $_SERVER["SCRIPT_FILENAME"];
$host = "localhost";
$user = "root";
$pass = "phpxphp";
?>

<HTML>
<HEAD>
	<TITLE><?php echo $title?></TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#CCCCCC" LINK="#0000FF" VLINK="#660099" ALINK="#0000FF">
<CENTER>

<H1><?php echo $title?></H1>
<H2><?php echo $host?></H2>
<H2><?php echo $user?></H2>
<H2><?php echo $pass?></H2>

<?php

$link = mysql_connect($host, $user, $pass);

if (!$link) {
	die('Could not connect: ' . mysql_error());
	}

echo 'Connected successfully';
mysql_close($link);
?>

Terminology

September 1, 2011
API
background
browser-safe
BuddyPress
canvas
categories
child-theme
comments
components
CSS
customizable
Dashboard
display
drop-down
Easel
feature-rich
feeds
fixed-width
flexible-width
framework-like
friendly
full-width
gallery
handles
header
highlight
includes
integrated
layouts
multi-level
options
pages
plugin
power-packed
pre-defined
rewrite
roles
RTL
rules
schemes
semantic
showcase
sidebar
slideshow
stylesheet
supports
templates
themes
threaded-comments
ultra-minimal
versatile
vintage
widget-ready
widgets

Installation

September 1, 2011

Download and unpack the package from wordpress.org and put the folder into your localhost directory.

These are the files that come into play first after installation. The wp-config.php is a copy of the sample file with these lines configured by you:

define('DB_NAME', 'database_name_here');

define('DB_USER', 'username_here');

define('DB_PASSWORD', 'password_here');

define('DB_HOST', 'localhost');

These 18 files above are those you will need beyond this point.

BTW: You may have to set permissions for the wp-content directory to be Read & Write for everyone, and “Apply to enclosed item …”

Content Management Systems

August 31, 2011

WordPress, Joomla, Drupal are drawing closer to each other in terms of functionality

  • Ease of setup: WP
  • Content Editors: WP
  • Site Administration: WP
  • Accessibility and SEO: Joomla
  • Structural Flexibility: Drupal
  • User Roles and Workflow: Joomla
  • Community/Web 2.0 Functionality: WP, Drupal

WordPress is a basic blogging tool. It provides a user interface where you can work in an easy and intuitive manner. It handles the logistics involved in making your composition presentable and publicly available, allowing you to focus on what you want to write.

Domain Registration

August 31, 2011

pingbacks

August 31, 2011

Pingbacks happen when authors of other blogs cite an article from another site in their own articles.

Here is a typical email:

From: “WordPress.com” <donotreply@wordpress.com>
Date: August 31, 2011 2:49:04 PM PDT
To: ggarchar@zapmap.com
Subject: [Ten Edges] Please moderate: “WP.org”

A new pingback on the post “WP.org” is waiting for your approval

http://tenedges.com/wp-org/

Website : Lesson Plan &laquo; Ten Edges (IP: 69.170.134.202 , 69.170.134.202)
URL    : http://tenedges.com/2011/08/31/lesson-plan/
Pingback excerpt:
[...] WordPress Can Do For You WordPress Basics Using The WordPress Hosted Service [...]

Approve it: http://tenedges.wordpress.com/wp-admin/comment.php?action=approve&c=23
Trash it: http://tenedges.wordpress.com/wp-admin/comment.php?action=trash&c=23
Spam it: http://tenedges.wordpress.com/wp-admin/comment.php?action=spam&c=23
Currently 2 comments are waiting for approval. Please visit the moderation panel:

http://tenedges.wordpress.com/wp-admin/edit-comments.php?comment_status=moderated


Follow

Get every new post delivered to your Inbox.