Jump to content

Inserting a page into a mysql database


Recommended Posts

What I'm trying to do is insert a HTML page into a mysql database and with no luck. Can some one show me how to do this.


insert  into 'templates'('name','template') values ('header','
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script language="javascript" src="click.js"></script>
<link href="styles.css" rel="stylesheet" type="text/css">



<table width="99%" align="center" height="82" border="0" cellpadding="0" cellspacing="0" class="header">
  <td align="center"><h1>{SITE_NAME}</h1></td>


Link to comment
Share on other sites

Ignoring the fact that this isn't a good idea in the first place, the issue is likely quoting.  You need mysql_real_escape_string().


Explain. Why won't it be a good idea. Since there are CMS in PHP that use this option. and can you give me a sample of how to use mysql_real_escape_string().


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.