I need smart people..

<?php
$con = mysql_connect("localhost","name","*password*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
1240325175_roflbrothel.gif

}

$sql = "SELECT value FROM `phplist_userstats` WHERE value > 1000";
echo "$sql users on the mailing list"
?>

There I fixed it.

:laugh2: You are good idea.
 
<?php
$con = mysql_connect("localhost","name","*password*");
if (!$con)
{
die('Could not connect: ' . mysql_error());
1240325175_roflbrothel.gif

}

$sql = "SELECT value FROM `phplist_userstats` WHERE value > 1000";
echo "$sql users on the mailing list"
?>

There I fixed it.

:laugh2:
 
$sql can't be "echo"ed as is

Since your query can get you multiple value that are bigger than 1000 you need a loop

while ($row=mysql_fetch_assoc($sql)){
echo $row['value']." users on the mailing list ";
}

but that doesn't seem to make sense, you may want to do "select count(*) from `phplist_userstats` where value >1000" if what you want is how many entries there are.


matt
irlysm :)
 
Yea I want to extract a piece of information from the mysql database i have on my website and post it.

Im not sure if the Joomla CMS will cause issues with the php?
 
Yea I want to extract a piece of information from the mysql database i have on my website and post it.

Im not sure if the Joomla CMS will cause issues with the php?

Joomla been no issues so far for me. Be sure PHP 'n MySql are on latest update. I use SSH to do the jobs.
 
Joomla been no issues so far for me. Be sure PHP 'n MySql are on latest update. I use SSH to do the jobs.

Both are updated. I just wanted joomla to draw the information out of the database that it is not using. (other database) so.. is it possible?
 
Both are updated. I just wanted joomla to draw the information out of the database that it is not using. (other database) so.. is it possible?

Are you saying you wanted to do a backup or something? Please give us your purpose.
 
Are you saying you wanted to do a backup or something? Please give us your purpose.

Nah.

I run joomla on a website. It has its own database. I also have a php mailer on it. It has its own separate database.

I just want to be able to update a certain module on joomla to show how many subscribers we have automatically rather than me updating it.
 
Nah.

I run joomla on a website. It has its own database. I also have a php mailer on it. It has its own separate database.

I just want to be able to update a certain module on joomla to show how many subscribers we have automatically rather than me updating it.

Thanks for your description. I assume you're using phplist? If not, which extension are you using?

Also you could post your issue @ MySQL :: MySQL Forums
 
Could you try this SQL script in the quote below, you have to actually execute it, then count the rows.

Hope this helps!

$query = mysql_query($sql);
$noofusers = mysql_num_rows($query);
 
Halo -

Tried that, and got an error with the $noofusers line

Wow.. This is getting much harder than I thought lol
 
Off the record, I recalled my teacher that she said to us in my class that we should create somewhat a simple program in order to avoid too complicated in programming. Otherwise, your program will look like a spaghetti that you will never find it even the bug program is still not perfect. Even, you work for a company, and they could fire you for such a mess. I am just saying that it would be less stress for you to work with some easy programs. Otherwise, you would end up wearing very thick and heavy reading glasses for rest of your life - oh I am not kidding. I know my friends, and it is very sad.
 
Off the record, I recalled my teacher that she said to us in my class that we should create somewhat a simple program in order to avoid too complicated in programming. Otherwise, your program will look like a spaghetti that you will never find it even the bug program is still not perfect. Even, you work for a company, and they could fire you for such a mess. I am just saying that it would be less stress for you to work with some easy programs. Otherwise, you would end up wearing very thick and heavy reading glasses for rest of your life - oh I am not kidding. I know my friends, and it is very sad.

You see how complicated the code is on the top? Only like 10 lines.
It's not 500 lines. gosh.
 
Back
Top