PDM
-
Posts
12 -
Joined
-
Last visited
Never
Posts posted by PDM
-
-
I'm having a problem copying data from fields that contain html code.
I'm getting the data from the table using php and can output it to the browser without problem.
$thisPostDate = $row_GetBlogBase['PostDate']; $thisCategory = $row_GetBlogBase['Category']; $thisAuthorName = $row_GetBlogBase['AuthorName']; $thisAuthorEmail = $row_GetBlogBase['AuthorEmail']; $thisTitle = $row_GetBlogBase['Title']; $thisDesc = $row_GetBlogBase['Desc']; $thisKeywords = $row_GetBlogBase['Keywords']; $thisHeadline = $row_GetBlogBase['Headline']; $thisIntro = $row_GetBlogBase['Intro']; $thisNewsStory = $row_GetBlogBase['NewsStory']; $insertSQL = "INSERT INTO news_blog (PostDate, Category, AuthorName, AuthorEmail, Title, `Desc`, Keywords, Headline, Intro, NewsStory) VALUES ('$thisPostDate', '$thisCategory', '$thisAuthorName', '$thisAuthorEmail', '$thisTitle', '$thisDesc', '$thisKeywords', '$thisHeadline, '$thisIntro', '$thisNewsStory')"; mysql_select_db($database_MyBLOGS, $MyBLOGS); $Result1 = mysql_query($insertSQL, $MyBLOGS) or die(mysql_error());
When $thisNewsStory contains html code
<img src="http://www.myweb.com/images/topleft.gif" align="right" vspace="5" hspace="5" border="1">
I get a mySQL syntal error like
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 'src="http://www.myweb.com/images/topleft.gif" align="right" vspace="5" hspace="5' at line 1
???
-
Found it `fulltext` works
Thanks again Andy!!!
-
Thanks Andy, I missed that!!
I wonder how Joomla is getting around that???
This table works in several sites I'm running Joomla on this same server.
???
-
Mysql 5 or 3
PHP 3
I have this table jos_content I get a mysql syntax error trying to insert a record
Field Type Collation Null Key Default Extra Privileges Comment
---------------- ---------------- ----------------- ------ ------ ------------------- -------------- ------------------------------- -------
id int(11) unsigned (NULL) NO PRI (NULL) auto_increment select,insert,update,references
title varchar(100) latin1_swedish_ci NO select,insert,update,references
title_alias varchar(100) latin1_swedish_ci NO select,insert,update,references
introtext mediumtext latin1_swedish_ci NO select,insert,update,references
fulltext mediumtext latin1_swedish_ci NO select,insert,update,references
state tinyint(3) (NULL) NO MUL 0 select,insert,update,references
sectionid int(11) unsigned (NULL) NO MUL 0 select,insert,update,references
mask int(11) unsigned (NULL) NO MUL 0 select,insert,update,references
catid int(11) unsigned (NULL) NO MUL 0 select,insert,update,references
created datetime (NULL) NO 0000-00-00 00:00:00 select,insert,update,references
created_by int(11) unsigned (NULL) NO 0 select,insert,update,references
created_by_alias varchar(100) latin1_swedish_ci NO select,insert,update,references
modified datetime (NULL) NO 0000-00-00 00:00:00 select,insert,update,references
modified_by int(11) unsigned (NULL) NO 0 select,insert,update,references
checked_out int(11) unsigned (NULL) NO MUL 0 select,insert,update,references
checked_out_time datetime (NULL) NO 0000-00-00 00:00:00 select,insert,update,references
publish_up datetime (NULL) NO 0000-00-00 00:00:00 select,insert,update,references
publish_down datetime (NULL) NO 0000-00-00 00:00:00 select,insert,update,references
images text latin1_swedish_ci NO select,insert,update,references
urls text latin1_swedish_ci NO select,insert,update,references
attribs text latin1_swedish_ci NO select,insert,update,references
version int(11) unsigned (NULL) NO 1 select,insert,update,references
parentid int(11) unsigned (NULL) NO 0 select,insert,update,references
ordering int(11) (NULL) NO 0 select,insert,update,references
metakey text latin1_swedish_ci NO select,insert,update,references
metadesc text latin1_swedish_ci NO select,insert,update,references
access int(11) unsigned (NULL) NO MUL 0 select,insert,update,references
hits int(11) unsigned (NULL) NO 0
Taking values from a form I get a syntax error with the following code
$insertSQL = sprintf("INSERT INTO jos_content (title, title_alias, introtext, fulltext, state, sectionid, mask, catid, created, created_by, created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['title'], "text"), GetSQLValueString($_POST['title_alias'], "text"), GetSQLValueString($_POST['introtext'], "text"), GetSQLValueString($_POST['fulltext'], "text"), GetSQLValueString($_POST['state'], "int"), GetSQLValueString($_POST['sectionid'], "int"), GetSQLValueString($_POST['mask'], "int"), GetSQLValueString($_POST['catid'], "int"), GetSQLValueString($_POST['created'], "date"), GetSQLValueString($_POST['created_by'], "int"), GetSQLValueString($_POST['created_by_alias'], "text"), GetSQLValueString($_POST['modified'], "date"), GetSQLValueString($_POST['modified_by'], "int"), GetSQLValueString($_POST['checked_out'], "int"), GetSQLValueString($_POST['checked_out_time'], "date"), GetSQLValueString($_POST['publish_up'], "date"), GetSQLValueString($_POST['publish_down'], "date"), GetSQLValueString($_POST['images'], "text"), GetSQLValueString($_POST['urls'], "text"), GetSQLValueString($_POST['attribs'], "text"), GetSQLValueString($_POST['version'], "int"), GetSQLValueString($_POST['parentid'], "int"), GetSQLValueString($_POST['ordering'], "int"), GetSQLValueString($_POST['metakey'], "text"), GetSQLValueString($_POST['metadesc'], "text"), GetSQLValueString($_POST['access'], "int"), GetSQLValueString($_POST['hits'], "int")); mysql_select_db($database_connNMFFG, $connNMFFG); $Result1 = mysql_query($insertSQL, $connNMFFG) or die(mysql_error());
I use The above style code using DreamWeaver with no problem on hundreds of tables but apparently something to do with jos_content table structure that I don't understand is creating a problem.
???
-
From the Menu choose Site > Manage Sites >Highlight the site from the list > Edit > from the left column choose Remote Info
-
What version of DW ?
-
<?php echo $HTTP_POST_VARS['variable'];?>
-
I beleieve wht you are looking for is called recordset status or navigation.
If you already have a repeat region displaying your data then go to Insert > Application Object > Recordset Paging or Recordcount Status
-
Found the if problem.
Deleting the ; at the end of the if line fixed that.
Another issue now.
I need to run this same loop with different select strings and 6 different places on the page.
If I try to run the loop a second or third time, at different locations below in the page it fails to return any values.
It seems as if I'm only allow to run the loop once per page????
-
Tried this loop but must have something wrong with my if syntax cause it outputs all records value for 'PkgRate'
<?php do { if ($row_GetPackages['PackageName'] == '5 Days Fishing'); echo "$".$row_GetPackages['PkgRate']; } while ($row_GetPackages = mysql_fetch_assoc($GetPackages)); ?>
-
I'm having trouble figuring out how to select records from my query.
<?php mysql_select_db($database_BA, $BA); $query_GetPackages = "SELECT * FROM destpackage WHERE DestinationName = 'Lake Guri Resort' ORDER BY PackageName ASC"; $GetPackages = mysql_query($query_GetPackages, $BA) or die(mysql_error()); $row_GetPackages = mysql_fetch_assoc($GetPackages); $totalRows_GetPackages = mysql_num_rows($GetPackages); ?>
I have the above query on a page where I'm using records selected to populate two drop downs.
I'd also like to select other fields from this same query based on specific ID column values.
For example I'd like to output the Price field for a record in the above query where the ID field = 41.
I know I could create another query to do this but I need to do this 6 times for this page and don't want to create 6 times the server load by using 7 queries on the page.
I know this should be real simple but I can't seem to formulate a search phrase correctly to get the answer from a forum or web search.
???
[SOLVED] Copy mySQL table data containing html
in MySQL Help
Posted
Found missing '
'$thisHeadline