var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Update NAME_OF_SITE problem Need Help
I'm having trouble with this cant get it to work
This below will make a text box; in the text box you would put the name of whatever the site would be
then once you press next then it would update the sql table like text scrapping in the TABLE_metatags; Its supossed to rename the ="NAME_OF_SITE" PART but I cant get it to work proper it wont update
this part I've tried lots of things but no luck just yet.
this PHP page is form.php; this example calls once
<td class="inputField"><?php echo 'name of site<br />' . draw_input_field('SITE_CEW', null, 'class="text"'); ?></td>
then update works like this goes and updtes the Table_metatags
db_query('update ' . table_metatags . ' SET id = "' . trim($HTTP_POST['SITE_CEW']) . '" WHERE meta name = "description" AND Content = "NAME_OF_SITE"');
And this is the last thing it will do is rename the meta name in the
Table_metatags below example
-- Table structure for table `metatags`
CREATE TABLE IF NOT EXISTS `metatags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`mtags` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- Dumping data for table `metatags`
INSERT INTO `metatags` (`id`, `mtags`) VALUES
(1, '<meta name="description" content="NAME_OF_SITE" />\r\n<meta name="keywords" content="WHAT_ITS_ABOUT" />\r\n<meta name="author" content="THE_AUTHOR" />\r\n');
I need help with this I tried many things I know I'm close but
still cant seem to break this to make it work
Any help would grateful!!
Thank you much,
what you gotta do is test your sql
outside of php first
that way, you will obtain the benefit of seeing the actual mysql error message when you do stuff like this --
WHERE meta name = "description"
Update NAME_OF_SITE problem Need Help
your right r937,
I test the code by adding or die (mysql_error()); at end of the below code:
<code>db_query('update ' . table_metatags . ' SET id = "' . trim($HTTP_POST['SITE_CEW']) . '" WHERE meta name = "description" AND Content = "NAME_OF_SITE"') or die (mysql_error());</code>
same problem I suspected. but, don't know which should be in after the WHERE
statement thats where I have been hung up!
Need help on what belongs in after the WHERE = "NAME_OF_SITE"');
this was the result of running this test on the code below:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'name = "description" AND Content = "NAME_OF_SITE"' at line 1
Still need a hand on this, my mind is still duh at this point, Momentarily?
Thanks ahead of time!!!
This usually indicates that the error is just before 'name = "description"...'. If you check the syntax of the statement you will see your problem.
Tryed still hung up on this and need help on this it will not update
please show the exact query that you pass to mysql
Originally Posted by
not the php code that produces the query, but the actual query itself
then show the entire error message
Can you show us your table definition? Your issue is with the field meta name. This must be encapsulated within `meta name`as it should appear as a single field name.
he already did, in post #1
Originally Posted by