Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
<? if column is empty insert this content ?> How ?
Old 05-13-2010, 10:45 AM <? if column is empty insert this content ?> How ?
Experienced Talker

Posts: 38
Name: EarnGate
Trades: 0
Hello,
we have web directory script have 50000 links and some links haven't its keywords

1- this is links table structure
Code:
CREATE TABLE IF NOT EXISTS `dn_links` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `url` varchar(255) NOT NULL default '',
  `recip` varchar(255) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `detail` text NOT NULL,
  `keywords` text NOT NULL,
)  ;
2-we have function to get meta

PHP Code:
function link_submitted_meta($in) {
global 
$s,$m;
$form get_meta_tags($in[url]);
$form[url] = $in[url];
if (!
$form[title])
$x file($in[url]);
  foreach (
$x as $k=>$v)
  { 
$k strstr(trim(stripslashes($v)),'<TITLE>'); if (!$k$k strstr(trim(stripslashes($v)),'<title>');
    if (
$k) { $form[title] = eregi_replace('<title>','',eregi_replace('</title>','',$k)); break; } 
  }
}
$s[subm_all] = 1;
link_submit_form($in[selected_category],$form);

so that we want
php code to check if " keyword filed is empty " > generate keyword automatically by this function
and insert keywords to this field
How we do that ?
earngate is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-14-2010, 10:22 PM Re: <? if column is empty insert this content ?> How ?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Select the rows from the table where the keyword is blank, run the desired data through your function, and then execute an update command to update the row.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to <? if column is empty insert this content ?> How ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09908 seconds with 12 queries