<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Jsp, Tomcat, J2Ee, Hibernate Programming, Http Web Server Blog</title>
	<link>http://mysql5.armadillowebhosting.com</link>
	<description>Weblog about Tomcat Java and web site hosting</description>
	<pubDate>Tue, 10 Jun 2008 07:14:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>MANAGING CONTENT // create database  (Web hosting domain names) connection $conn =</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/managing-content-create-database-web-hosting-domain-names-connection-conn/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/managing-content-create-database-web-hosting-domain-names-connection-conn/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 07:14:44 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/managing-content-create-database-web-hosting-domain-names-connection-conn/</guid>
		<description><![CDATA[MANAGING CONTENT   // create database connection $conn = dbConnect(&#8217;admin&#8217;); // get details of selected record if (isset($_GET[&#8217;article_id&#8217;]) &#038;&#038; !$_POST) {   // prepare SQL query $sql = &#8216;SELECT article_id, title, article   FROM journal WHERE article_id = ?&#8217;; // initialize statement $stmt = $conn->stmt_init(); if ($stmt->prepare($sql)) {   // bind [...]]]></description>
			<content:encoded><![CDATA[<p>MANAGING CONTENT   // create database connection $conn = dbConnect(&#8217;admin&#8217;); // get details of selected record if (isset($_GET[&#8217;article_id&#8217;]) &#038;&#038; !$_POST) {   // prepare SQL query $sql = &#8216;SELECT article_id, title, article   FROM journal WHERE article_id = ?&#8217;; // initialize statement $stmt = $conn->stmt_init(); if ($stmt->prepare($sql)) {   // bind the query parameters $stmt->bind_param(&#8217;i', $_GET[&#8217;article_id&#8217;]); // bind the results to variables $stmt->bind_result($article_id, $title, $article); // execute the query, and fetch the result $OK = $stmt->execute(); $stmt->fetch(); }   }  // redirect if $_GET[&#8217;article_id&#8217;] not defined  if (!isset($_GET[&#8217;article_id&#8217;])) {   header(&#8217;Location: http://localhost/phpsolutions/admin/ .   journal_list.php&#8217;);  exit;  }   // display error message if query fails   if (isset($stmt) &#038;&#038; !$OK &#038;&#038; !$done) {  echo $stmt->error;  }   ?>   Although this is very similar to the code used for the insert page, the first few lines  are outside the conditional statements. Both stages of the update process require  the include files, the removal of backslashes, and the database connection, so this  avoids the need to duplicate the same code later. Two flags are initialized: $OK to  check the success of retrieving the record, and $done to check whether the update  succeeds.   The first conditional statement makes sure that $_GET[&#8217;article_id&#8217;] exists and  that the $_POST array is empty. So the code inside the braces is executed only when  the query string is set, but the form hasn t been submitted.   You prepare the SELECT query in the same way as for an INSERT command, using a  question mark as a placeholder for the variable. However, note that instead of using  an asterisk to retrieve all columns, the query specifies three columns by name like this:   $sql = &#8216;SELECT article_id, title, article  FROM journal WHERE article_id = ?&#8217;;   365    <br />If you are searching for cheap webhost for your web application, please visit <a href="http://tomcat.b5websitehosting.com">MySQL5 Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/managing-content-create-database-web-hosting-domain-names-connection-conn/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Free web host - PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY //</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/free-web-host-php-solutions-dynamic-web-design-made-easy/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/free-web-host-php-solutions-dynamic-web-design-made-easy/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 15:06:35 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/free-web-host-php-solutions-dynamic-web-design-made-easy/</guid>
		<description><![CDATA[PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   // prepare the SQL query $sql = &#8220;UPDATE journal SET title = &#8216;$title&#8217;, article = &#8216;$article&#8217; WHERE article_id = $article_id&#8221;; // submit the query $done = mysql_query($sql) or die(mysql_error()); }   // redirect page on success or $article_id is invalid if ($done &#124;&#124; !isset($article_id)) { [...]]]></description>
			<content:encoded><![CDATA[<p>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   // prepare the SQL query $sql = &#8220;UPDATE journal SET title = &#8216;$title&#8217;, article = &#8216;$article&#8217; WHERE article_id = $article_id&#8221;; // submit the query $done = mysql_query($sql) or die(mysql_error()); }   // redirect page on success or $article_id is invalid if ($done || !isset($article_id)) {   Most of this code should be familiar. Any backslashes inserted by magic quotes will  have been removed by nukeMagicQuotes() because you placed it outside the conditional statements in step 1, so this code block begins by passing items in the  $expected array to mysql_real_escape_string() to prepare them for insertion  into the database, and storing them in shorter variables ($title, $article, and  $article_id).   Because it s possible to tamper with a hidden field, you make sure that $article_id  is numeric before carrying on.   In the UPDATE query, strings need to be quoted, so the entire query is enclosed in  double quotes, with $title and $article in single quotes.   Although the mysql_query() function returns a result set from a SELECT query,  with UPDATE, it returns true or false. So, if the update succeeds, $done is reset to  true. You need to add $done || to the condition that controls the page redirection  script. This redirects the page either if $done is true or if $article_id is invalid.   8. Save journal_update.php and test it by loading journal_list.php, selecting one  of the EDIT links, and making changes to the record that is displayed. When you  click Update record, you should be taken back to journal_list.php. You can verify  that your changes were made by clicking the same EDIT link again.  Check your code, if necessary, with journal_update_mysql02.php.   PHP Solution 13-6: Updating a record with MySQL Improved  Use journal_update01.php fromthe download files. The code for the first stage of  the update process is in journal_update_mysqli01php, and the final code is in  journal_update_mysqli02.php.   1. The first stage involves retrieving the details of the record that you want to update.  Put the following code above the DOCTYPE declaration:  <?php include('../includes/conn_mysqli.inc.php'); include('../includes/corefuncs.php'); // remove backslashes nukeMagicQuotes(); // initialize flags $OK = false; $done = false;    <br />Please visit our <a href="http://php5.jspwebsitehosting.com">professional web hosting</a> services to find out about cheap and reliable webhost service that will surely answer all your demands.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/free-web-host-php-solutions-dynamic-web-design-made-easy/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MANAGING CONTENT The Update entry button  (Top ten web hosting) doesn t do</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/managing-content-the-update-entry-button-top-ten-web-hosting-doesn-t-do/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/managing-content-the-update-entry-button-top-ten-web-hosting-doesn-t-do/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 23:19:15 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/managing-content-the-update-entry-button-top-ten-web-hosting-doesn-t-do/</guid>
		<description><![CDATA[MANAGING CONTENT   The Update entry button doesn t do anything yet. Just make sure that everything is  displayed correctly, and confirm that the primary key is registered in the hidden  field. You can check your code, if necessary, against journal_update_mysql01.php.    Figure 13-4. An update form uses the primary [...]]]></description>
			<content:encoded><![CDATA[<p>MANAGING CONTENT   The Update entry button doesn t do anything yet. Just make sure that everything is  displayed correctly, and confirm that the primary key is registered in the hidden  field. You can check your code, if necessary, against journal_update_mysql01.php.    Figure 13-4. An update form uses the primary key to retrieve and display a record ready for editing.   7. The name attribute of the submit button is update, so all the update processing code needs to go in a conditional statement that checks for the presence of update in the $_POST array. Place the code highlighted in bold just before the page redirect script: $row = mysql_fetch_assoc($result); }   // if form has been submitted, update record   if (array_key_exists(&#8217;update&#8217;, $_POST)) { // prepare expected items for insertion into database foreach ($_POST as $key => $value) {   if (in_array($key, $expected)) { ${$key} = mysql_real_escape_string($value); }   } // abandon the process if primary key invalid if (!is_numeric($article_id)) {   die(&#8217;Invalid request&#8217;); }   363    <br />Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision <a href="http://j2ee.armadillowebhosting.com">J2ee Web Hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/managing-content-the-update-entry-button-top-ten-web-hosting-doesn-t-do/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY  (Best web hosting) The</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-best-web-hosting-the/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-best-web-hosting-the/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 11:21:00 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-best-web-hosting-the/</guid>
		<description><![CDATA[PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   The final conditional statement redirects the page to journal_list.php if  $article_id was set to NULL earlier. A variable that has been set to NULL is considered unset, so !isset($article_id) returns true if $article_id is NULL.   2. Now that you have retrieved the contents [...]]]></description>
			<content:encoded><![CDATA[<p>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   The final conditional statement redirects the page to journal_list.php if  $article_id was set to NULL earlier. A variable that has been set to NULL is considered unset, so !isset($article_id) returns true if $article_id is NULL.   2. Now that you have retrieved the contents of the record, you need to display them  in the update form by using PHP to populate the value attribute of each input  field. Before doing so, it s a good idea to check that you actually have something to  display. If someone changes the value of article_id in the query string, you may  get an empty result set, so there is no point in going any further. Add the following  conditional statement immediately before the opening<br />
<form> tag:
<p><a href="journal_list.php">List all entries</a> </p>
<p>   <?php if (empty($row)) { ?><br />
<p class="warning">Invalid request: record does not exist.</p>
<p> <?php } else { ?><br />
<form id="form1" name="form1" method="post" action="">   If $row contains no values, empty($row) returns true and displays the warning message. The form is wrapped in the else clause and is displayed only if the query finds  a valid record to be updated. Add the closing curly brace of the else clause immediately after the closing </form>
<p> tag like this:   </form>
<p>   <?php } ?>   </body>   3. If $row isn t empty, you can display the results of the query without further testing.  However, you need to pass text values to htmlentities() to avoid any problems  with the display of quotes. Change the code in the title input field like this:  <input name="title" type="text" class="widebox" id="title" . value="<?php echo htmlentities($row['title']); ?>&#8221; />   4. Do the same for the article text area. Because text areas don t have a value  attribute, the code goes between the opening and closing <textarea> tags like this:  <textarea name="article" cols="60" rows="8" class="widebox" .  id="article"><?php echo htmlentities($row['article']); ?></textarea>   Make sure there is no space between the opening and closing PHP and <textarea>  tags. Otherwise, you will get unwanted spaces in your updated record.   5. The UPDATE command needs to know the primary key of the record you want to  change. Store the primary key in a hidden field so that it is submitted in the $_POST  array with the other details. Because hidden fields are not displayed onscreen, the  following code can go anywhere inside the form:  <input name="article_id" type="hidden" value="<?php . echo $row['article_id']; ?>&#8221; />   6. Save the update page, and test it by loading journal_list.php into a browser and  selecting the EDIT link for one of the records. The contents of the record should be  displayed in the form fields as shown in Figure 13-4.   <br />Searching for affordable and proven webhost to host and run your servlet applications? Go to <a href="http://linux.b5websitehosting.com">Linux Web Hosting</a> services and you will find it.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-best-web-hosting-the/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MANAGING CONTENT // remove backslashes nukeMagicQuotes(); // initialize  (Cpanel web hosting)</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/managing-content-remove-backslashes-nukemagicquotes-initialize-cpanel-web-hosting/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/managing-content-remove-backslashes-nukemagicquotes-initialize-cpanel-web-hosting/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 17:08:49 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/managing-content-remove-backslashes-nukemagicquotes-initialize-cpanel-web-hosting/</guid>
		<description><![CDATA[MANAGING CONTENT   // remove backslashes nukeMagicQuotes(); // initialize flag $done = false; // prepare an array of expected items $expected = array(&#8217;title&#8217;, &#8216;article&#8217;, &#8216;article_id&#8217;); // create database connection $conn = dbConnect(&#8217;admin&#8217;); // get details of selected record if ($_GET &#038;&#038; !$_POST) {   if (isset($_GET[&#8217;article_id&#8217;]) &#038;&#038; is_numeric($_GET[&#8217;article_id&#8217;])) {  $article_id = $_GET[&#8217;article_id&#8217;]; [...]]]></description>
			<content:encoded><![CDATA[<p>MANAGING CONTENT   // remove backslashes nukeMagicQuotes(); // initialize flag $done = false; // prepare an array of expected items $expected = array(&#8217;title&#8217;, &#8216;article&#8217;, &#8216;article_id&#8217;); // create database connection $conn = dbConnect(&#8217;admin&#8217;); // get details of selected record if ($_GET &#038;&#038; !$_POST) {   if (isset($_GET[&#8217;article_id&#8217;]) &#038;&#038; is_numeric($_GET[&#8217;article_id&#8217;])) {  $article_id = $_GET[&#8217;article_id&#8217;];  }   else { $article_id = NULL; }   if ($article_id) { $sql = &#8220;SELECT * FROM journal   WHERE article_id = $article_id&#8221;; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_assoc($result); }   }  // redirect page if $article_id is invalid  if (!isset($article_id)) {   header(&#8217;Location: http://localhost/phpsolutions/admin/ .   journal_list.php&#8217;);  exit;  }   ?>   Although this is very similar to the code used for the insert page, the first few lines  are outside the conditional statement. Both stages of the update process require  the include files, the removal of backslashes, and the database connection, so this  avoids the need to duplicate code. The $done flag is initialized as false and will be  used later to test whether the update succeeded.   There s an important addition to the $expected array. When a record is first  inserted, the primary key is generated automatically by MySQL. However, when you  update a record, you need its article_id to identify it.   The first conditional statement checks that the $_GET array contains at least one  value and that the $_POST array is empty. This makes sure that the code inside is  executed only when the query string is set, but the form hasn t been submitted.  Before building the SQL query, you need to check that $_GET[&#8217;article_id&#8217;] has  been defined and pass it to is_numeric() to make sure that it contains only a  number. If someone comes directly to this page or an attacker tries to pass anything else to your query, $article_id is set to NULL.   If everything is OK, the SQL query is submitted. The result should contain only one  record, so its contents are extracted straight away and stored in $row.   361    <br />Visit our <a href="http://mysql5.b5websitehosting.com">web design programs</a> services for an affordable and reliable webhost to suit all your needs.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/managing-content-remove-backslashes-nukemagicquotes-initialize-cpanel-web-hosting/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY Updating  (Web hosting ecommerce)</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-updating-web-hosting-ecommerce/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-updating-web-hosting-ecommerce/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 23:06:26 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-updating-web-hosting-ecommerce/</guid>
		<description><![CDATA[PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   Updating records   An update page needs to perform two separate processes, as follows:   1. Retrieve the selected record and display it ready for editing  2. Update the edited record in the database  The first stage uses the primary key passed [...]]]></description>
			<content:encoded><![CDATA[<p>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   Updating records   An update page needs to perform two separate processes, as follows:   1. Retrieve the selected record and display it ready for editing  2. Update the edited record in the database  The first stage uses the primary key passed in the URL query string. So far, you have used  SELECT to retrieve all records or a range of records (using LIMIT). To retrieve a specific  record identified by its primary key, you add a WHERE clause to the end of the SELECT query  like this:   SELECT * FROM table_name WHERE primary_key_column = primary_key   Whereas PHP uses two equal signs (==) to test for equality, MySQL uses only one (=).  Don t get the two mixed up.  After you have edited the record in the update page, you submit the form and pass all  the details to an UPDATE command. The basic syntax of the SQL UPDATE command looks  like this:   UPDATE table_name SET column_name = value, column_name = value  WHERE condition   The condition when updating a specific record is the primary key. So, when updating  article_id 2 in the journal table, the basic UPDATE query looks like this:   UPDATE journal SET title = value, article = value WHERE article_id = 2   Although the basic principle is the same for each method of connecting to MySQL, the  code differs sufficiently to warrant separate instructions.   PHP Solution 13-5: Updating a record with the original MySQL extension  Use journal_update01.php fromthe download files. The code for the first stage of the  update process is in journal_update_mysql01php, and the final code is in  journal_update_mysql02.php.   1. The first stage involves retrieving the details of the record that you want to update.  Since the primary key is passed through the query string, you need to extract it  from the $_GET array and make sure that it s safe to use before incorporating it into  your SQL query. Put the following code above the DOCTYPE declaration:  <?php include('../includes/conn_mysql.inc.php'); include('../includes/corefuncs.php');    <br />Please visit <a href="http://domain.b5websitehosting.com">Domain Name Hosting</a> services for high quality webhost to host and run your jsp applications.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-updating-web-hosting-ecommerce/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MANAGING CONTENT For PDO, use this: This is  (Medical web site)</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/managing-content-for-pdo-use-this-this-is-medical-web-site/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/managing-content-for-pdo-use-this-this-is-medical-web-site/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 07:12:09 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/managing-content-for-pdo-use-this-this-is-medical-web-site/</guid>
		<description><![CDATA[MANAGING CONTENT   For PDO, use this:   
   
   This is the same as in the previous chapter, so it should need no explanation.   4. Display the created and title fields for the current record in the first two cells of  the second row like [...]]]></description>
			<content:encoded><![CDATA[<p>MANAGING CONTENT   For PDO, use this:   </tr>
<p>   <?php foreach ($conn->query($sql) as $row) { ?><br />
<tr>   This is the same as in the previous chapter, so it should need no explanation.   4. Display the created and title fields for the current record in the first two cells of  the second row like this:
<td><?php echo $row['created']; ?></td>
<td><?php echo $row['title']; ?></td>
<p>   5. Add the query string and value of the article_id field for the current record to  both URLs in the next two cells like this:
<td><a href="journal_update.php?article_id=<?php echo . $row['article_id']; ?>&#8220;>EDIT</a></td>
<td><a href="journal_delete.php?article_id=<?php echo . $row['article_id']; ?>&#8220;>DELETE</a></td>
<p>   What you re doing here is adding ?article_id= to the URL, and then using PHP to  display the value of $row[&#8217;article_id&#8217;]. It s important that you don t leave any  spaces that might break the URL or the query string. A common mistake is to leave  spaces around the equal sign. After the PHP has been processed, the opening <a>  tag should look like this (although the number will vary according to the record):   <a href="journal_update.php?article_id=2">   6. Finally, close the loop surrounding the second table row with a curly brace like this:  </tr>
<p>   <?php } ?>   </table>
<p>   7. Save journal_list.php and load the page into a browser. Assuming that you loaded  the contents of journal.sql into the phpsolutions database earlier, you should see  a list of four items, as shown in Figure 13-3. You can now test journal_insert.php.  After inserting an item, you should be returned to journal_list.php, and the date  and time of creation, together with the title of the new item, should be displayed  at the top of the list. Check your code against the download files if you encounter  any problems.  The code in journal_list.php assumes that there will always be some  records in the table. As an exercise, use the technique in PHP Solution 11-2  (MySQL original and MySQLI), or 11-3 (PDO) to count the number of  results, and use a conditional statement to display a suitable message if no  records are found. The solution is in journal_list_norec_mysql.php,  journal_list_norec_mysqli.php, and journal_list_norec_pdo.php.  13  359    <br />Visit our <a href="http://mysql5.b5websitehosting.com">web design programs</a> services for an affordable and reliable webhost to suit all your needs.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/managing-content-for-pdo-use-this-this-is-medical-web-site/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Shared web hosting - PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY EDIT</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/shared-web-hosting-php-solutions-dynamic-web-design-made-easy-edit/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/shared-web-hosting-php-solutions-dynamic-web-design-made-easy-edit/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 13:15:38 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/shared-web-hosting-php-solutions-dynamic-web-design-made-easy-edit/</guid>
		<description><![CDATA[PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY



EDIT
DELETE


   PHP Solution 13-4: Creating the links to the update and delete pages  Use journal_list01.php in the download files. Depending on the method used to connect  to MySQL, the finished code is in journal_list_mysql.php, journal_list_mysqli.php, or  journal_list_pdo.php.   1. You need to connect [...]]]></description>
			<content:encoded><![CDATA[<p>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY<br />
<tr>
<td></td>
<td></td>
<td><a href="journal_update.php">EDIT</a></td>
<td><a href="journal_delete.php">DELETE</a></td>
</tr>
</table>
<p>   PHP Solution 13-4: Creating the links to the update and delete pages  Use journal_list01.php in the download files. Depending on the method used to connect  to MySQL, the finished code is in journal_list_mysql.php, journal_list_mysqli.php, or  journal_list_pdo.php.   1. You need to connect to MySQL and create the SQL query. Add the following code  above the DOCTYPE declaration:  <?php include('../includes/connection.inc.php'); // create database connection $conn = dbConnect('query'); $sql = 'SELECT * FROM journal ORDER BY created DESC'; ?>   I have used the generic filename connection.inc.php. Make sure you use the correct connection file for whichever method you re using to connect to MySQL.   2. If you re using the original MySQL extension or MySQL Improved, you need to submit the query. If you re using PDO, you can skip straight to step 3.  For the original MySQL extension, add the following line immediately before the  closing PHP tag:   $result = mysql_query($sql) or die(mysql_error());   For MySQL Improved, use this line instead:   $result = $conn->query($sql) or die(mysqli_error());   3. You now need to enclose the second table row in a loop and retrieve each record  from the result set. The following code goes between the closing </tr>
<p> tag of the  first row and the opening<br />
<tr> tag of the second row.  For the original MySQL extension, use this:   </tr>
<p>   <?php while($row = mysql_fetch_assoc($result)) { ?><br />
<tr>   For MySQL Improved, use this:   </tr>
<p>   <?php while($row = $result->fetch_assoc()) { ?><br />
<tr>We recommend high quality webhost to host and run your jsp application: <a href="http://jsp.armadillowebhosting.com">christian web host</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/shared-web-hosting-php-solutions-dynamic-web-design-made-easy-edit/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>MANAGING CONTENT To sort the results, add an  (Unlimited web hosting)</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/managing-content-to-sort-the-results-add-an-unlimited-web-hosting/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/managing-content-to-sort-the-results-add-an-unlimited-web-hosting/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 21:17:24 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/managing-content-to-sort-the-results-add-an-unlimited-web-hosting/</guid>
		<description><![CDATA[MANAGING CONTENT   To sort the results, add an ORDER BY clause. This sorts the records in alphabetical order by  title:   SELECT * FROM journal ORDER BY title   It s often convenient to display the most recent entry at the top of the list, so you can sort  [...]]]></description>
			<content:encoded><![CDATA[<p>MANAGING CONTENT   To sort the results, add an ORDER BY clause. This sorts the records in alphabetical order by  title:   SELECT * FROM journal ORDER BY title   It s often convenient to display the most recent entry at the top of the list, so you can sort  the results by the created column. To sort them in reverse (descending) order, add the  DESC keyword like this:   SELECT * FROM journal ORDER BY created DESC   You can use the results of this query to display a list of all records, complete with links  to the update and delete pages. By adding the value of article_id to a query string in  each link, you automatically identify the record to be updated or deleted. As you can  see in Figure 13-3, the URL displayed in the browser status bar (bottom left) identifies  the article_id of the article Trainee geishas go shopping as 2. This is used by  journal_update.php to display the correct record ready for updating. The same information is conveyed in the DELETE link to journal_delete.php.    Figure 13-3. The EDIT and DELETE links contain the record s primary key in a query string.   To create a list like this, you need to start with a table that contains two rows and as many  columns as you want to display, plus two extra columns for the EDIT and DELETE links. The  first row is used for column headings. The second row is wrapped in a PHP loop to display  all the results. The table in journal_list.php starts off like this (it s in journal_list01.php  in the download files):<br />
<table>
<tr>
<th scope="col">Created</th>
<th scope="col">Title</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<p>   357    <br />Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to <a href="http://mysql5.jspwebsitehosting.com">servlet web hosting</a> services.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/managing-content-to-sort-the-results-add-an-unlimited-web-hosting/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY 3.  (Web server setup)</title>
		<link>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-3-web-server-setup/</link>
		<comments>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-3-web-server-setup/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 05:01:37 +0000</pubDate>
		<dc:creator>humphreyblogart</dc:creator>
		
	<category>MYSQL5</category>
		<guid isPermaLink="false">http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-3-web-server-setup/</guid>
		<description><![CDATA[PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   3. The next stage is to initialize the prepared statement and bind the values from the  variables to the placeholders a process known as binding the parameters. Add  the following code:  // prepare the statement   $stmt = $conn->prepare($sql);   // [...]]]></description>
			<content:encoded><![CDATA[<p>PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY   3. The next stage is to initialize the prepared statement and bind the values from the  variables to the placeholders a process known as binding the parameters. Add  the following code:  // prepare the statement   $stmt = $conn->prepare($sql);   // bind the parameters and execute the statement   $stmt->bindParam(&#8217;:title&#8217;, $_POST[&#8217;title&#8217;], PDO::PARAM_STR);  $stmt->bindParam(&#8217;:article&#8217;, $_POST[&#8217;article&#8217;], PDO::PARAM_STR);  $OK = $stmt->execute();   This begins by passing the SQL query to the prepare() method of the database  connection ($conn), and storing a reference to the statement as a variable ($stmt).   Next, the values in the variables are bound to the placeholders in the SQL query.  Because the previous step uses explicit names for the placeholders, you need to do  this separately for each variable. The execute() method runs the query, and the  success or failure of the operation is stored in $OK.   4. Finally, redirect the page to a list of existing records or display any error message.  Add this code after the previous step:  // redirect if successful or display error   if ($OK) {  header(&#8217;Location: http://localhost/phpsolutions/admin/ .   journal_list.php&#8217;); exit; }   else { $error = $stmt->errorInfo(); echo $error[2]; }   } ?>   Since the prepared statement has been stored as $stmt, you can access an array of  error messages using $stmt->errorInfo(). The most useful information is stored  in the third element of the array.   That completes the insert page, but before testing it, create journal_list.php,  which is described next.   Linking to the update and delete pages   Before you can update or delete a record, you need to find its primary key. A practical way  of doing this is to display a list of all records. The following SQL query retrieves everything  from the journal table:   SELECT * FROM journal    <br />We would like to recommend you tested and proved <a href="http://jboss.jspwebsitehosting.com">virtual web hosting</a> services, which you will surely find to be of great quality.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://mysql5.armadillowebhosting.com/mysql5/php-solutions-dynamic-web-design-made-easy-3-web-server-setup/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
