Home     Articles & Projects     Products & Web Services     Forum

Forum

MYSQL Inner Join

Hi I am having a small issue with the following code, and I have no idea why it is not working

I am trying to show the data inside tbl_radio_now_playing.radio_now_playing_song But I also need to show the station name that is in tbl_radio_now_playing.radio_station_name

<?php
$sql
= "SELECT tbl_radio_now_playing.radio_station_id,
     tbl_radio_now_playing.radio_now_playing_song,
     tbl_radio_station.radio_station_id,
         tbl_radio_station.radio_station_name
     FROM tbl_radio_station JOIN tbl_radio_now_playing
     ON tbl_radio_now_playing.radio_station_id = tbl_radio_station.radio_station_id
     WHERE tbl_radio_now_playing.radio_now_playing_song LIKE '%$q%'"
;
    
   
$result = mysql_query($sql) or die ("Error Searching");
   
$row = mysql_fetch_assoc($result);
   
extract ($row);

print
$radio_now_playing_song;
print
$radio_station_name;
?>

Show only if user types in stock:

Hi i would like to know is there anyway to not show the following information if the user does not type in
stock:(then stock)

here is my code the url looks like
http://www.example.com/search?q=stock:msft
or
http://www.example.com/search?=stock:goog

what I need is to take the part after : and past that where the s=msft is.

{code saved}

<!– this is our table which displays the stock info –>
<!– we access the individual items by using $data[0]–>

<table>
<tr><td>description</td><td>latest figure</td><tr>
<tr><td>symbol</td><td><?php echo $data[0] ?></td></tr>
<tr><td>last price</td><td><?php echo $data[1] ?></td></tr>
<tr><td>date</td><td><?php echo $data[2] ?></td></tr>
<tr><td>time</td><td><?php echo $data[3] ?></td></tr>
<tr><td>change</td><td><?php echo $data[4] ?></td></tr>
<tr><td>open</td><td><?php echo $data[5] ?></td></tr>
<tr><td>high</td><td><?php echo $data[6] ?></td></tr>
<tr><td>low</td><td><?php echo $data[7] ?></td></tr>
<tr><td>volume</td><td><?php echo $data[8] ?></td></tr>
</table>

<?php
//close the filehandle $fp
fclose ($fp);
?>

Thanks

Joomla/wordpress Plugin

Hi I have looked everywhere but can find out how to do the following.
There is a new search engine that allows your posts to get straight no to some of the biggest search engines.
So no need for Google to spider your site every day or so.

What they require is the following information
site name
site URL
post title
post body
post keywords
post writtenby
Post URL Link

there API said that it needs to either be by using the post function or by the following

http://www.example.com/?site=[Name URL]&sitename=[Sitename]&posttitle=[Post Title]&postbody[Post Body]&keywords=[Keywords]&writtenby=[WrittenBy]&posturl=[Link to post]

From my understanding what they are doing is putting this into there DB.
It also makes one cool LIVE Real Time search engine.
The site also allows Podcasters however there is nothing in there blog that stats how, I can only guess this is a feature coming soon...

If you can help with how i would get it so that when i publish a story or post in wordpress or joomla it sends this information to them that would be great.

I understand what they are asking for but I don't know how to make a plugin for ether service that would do this.
Thanks
Russell

Re: Form processing

Hi everyone this is my first time posting here, with the help of David I have created a form for an astrological website. The form works great on one page but I needed to tweak it to gather information for two reports on another page unfortunately it doesn't work, here is the code:

Any help would be greatly appreciated.
Best wishes
Madeleine

{code saved}

RSS

Hi David
is it possible to create a rss feed from a page on my web site that is not in the data base of mysql. I have created a page of sales and coupons and would like create a feed for it.
Thank You in advance

Dean

MySQL Question

Hi David,

I was wondering if this little script is the most efficient way of checking if a particular handset has any deals associated with it. It works, just seems to take ages.

<?php
$sql
= "SELECT hs_id FROM `".DB_PREFIX."handsets`";
database_querySelect($sql,$rows);

foreach(
$rows as $deal) {
$sql = "SELECT hs_id FROM `".DB_PREFIX."deals` WHERE hs_id = '".$deal["hs_id"]."' LIMIT 1";
    if (
database_querySelect($sql,$rows)) {
   
$sql = "UPDATE `".DB_PREFIX."handsets` SET hs_deals = '1' WHERE hs_id='".$deal["hs_id"]."'";
   
database_queryModify($sql,$insertId);
    }
}
?>

Thanks,
Simon

MySQL Query Cache

Hi David,

Do you have any good / bad experiences with regards to turning on the "MySQL Query Cache" function. I am trying to speed up some of my sites and wondered if you had any words of wisdom for me?

Thanks,
Simon

$message = str_replace

Hi i want to block users from posting URL links
at the moment i am using this but it will only block the http://
i want if a user types in a url address i want it to say blocked instead of the URL
$message = str_replace( "http://", 'BLOCKED', $message);

PHP Joomla Template

Hi i am wondering if someone would be able to help me with this simple yet hard to find anywhere question/answer.

I have my main content and a right sidebar that i would like to show only if there is a modual in the right side. other wise i want it the main content to be 100%

if the right side is active i want the main content to be 80% and 20% for the right side.

Thanks
Russell Harrower

Including a PHP file not on your server

Hi i am wondering how do i include a file that is not hosted on my server.

The file has the PHP code to connect to the users database.

I have made a facebook application and i want to keep the code, but people would like to use my code, so i came up with a hosted server application

I have tryed to use include_once "http://yousite.com/link.php";
and so on but i cant get it to work

Any idea?

Syndicate content