Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Get List Of Messages From One Table, Message List Indicator From


I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not.

What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings.

SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = Ƈ') ORDER BY msgno DESC LIMIT 100

What I'm getting, though is a list that looks like this:

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1

I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary.

If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1.

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 2214 msgno: 0412141622 msglist: 1
mbxno: 2189 msgno: 0412141408 msglist: 1
mbxno: 0000 msgno: 0412141213 msglist: 1
mbxno: 0003 msgno: 0412141213 msglist: 1
mbxno: 2265 msgno: 0412132029 msglist: 1
mbxno: 0000 msgno: 0412131950 msglist: 1

How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?




View Complete Forum Thread with Replies

Related Forum Messages:
Putting Form Error Messages Into A List
I have some form validation and I want to put all the error messages that are displayed into a bulleted list. I have seen it done with more complicated validation using OOP but I don't know enough to do that. How would I add these error messages to a list if they occur? Code:

View Replies !
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.

View Replies !
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let
users to reach out to all recipient on the list by simple send the
email to a specific maillist- address.

Mailman has this functionn but as a just got a webserver account I
can't use mailman nor install it.

View Replies !
List All Table Fields
I'm looking for a script to list all fields in mysql database table, can someone show me a typical code or a link where I can get such info.

View Replies !
Dynamic List From Sql Table
I would like to put a dymanic select list on a form with the choices coming from a row of a table, table has the structure

id colour1 colour2 colour3

and I would like to give the dropdown the colour associated with the entry for each of colour 1-3 so if a line has

id=sss colour1=red colour2=black colour3=NULL

I would like the dynamic dropdown to have 2 choices, red or black but if the next row had

colour1=red colour2=black colour3=green

it picks up those values instead. The info for each id will be different, I have a table being built populated from the same table at the moment but built from different columns so I have a suitable record set already.

View Replies !
How Do You Insert A Value From Drop Down List To SQL Table?
I am a bit new to PHP and SQL so this may seem like a dumb question.

I have already created a drop down list as part of a form which is
automatically populated with values taken from a separate database. When a
user goes onto this page and either leaves the default value or selects a
value from the drop down list and presses the submit button, I would like
that selected value to be stored into a database which I have already
created in SQL.

Just to let you know that I can do the above using a text field but just
don't know how to do it with drop down list.

If your going to explain any coding then it may help if I give you the names
of certain items that are involved.

Database is called "Company"
Field within database is called "Name"

View Replies !
Displaying Table Field List
I got a function that displays a list of the fields in a certain mysql table.  I got it off of this site.  The problem is that it only displays the word Array and I'm not sure why.  This is the code for the function: Code:

View Replies !
How To Display Data In A Table With A List Box
I have a web page that displays data in a table which can be sorted dynamically. I also have a list box with a list of categories (engines, generators, all categories, etc.)

My goal is to have the user select a category that would display the products in that category. Or if they want to display all, they can.  Can I execute queries from the list box? If so, can someone give me a little example snippet on how to do it. (I was thinking maybe some IF THEN statemenst and include' sql.php' but I am not sure if this is feasible?

I know this can be done in javascript but I am not that experience in that language. But I was able to use javascript to sort the table dynamically becasue I found some instructions on how to do it. But I cant find any script on this topic. So I am a little stuck on how to go about  doing this.

View Replies !
List Of Products As An Output From A Db Table.
I have a list of products as an output from a db table. PHP Code:

foreach ( $items as $r )
{
   echo "<input type=text name=var1>&nbsp;".$r->itemName."<input type=hidden name=itemID><br>";
}

For one product I would just do: PHP Code:

query("UPDATE t1 SET value1='".$_POST['var1']."' WHERE id='".$_POST['itemID']."' LIMIT 1");

View Replies !
Dynamic List Populated By MySQL Table
I am building my first php page and I've ran into problems trying to create a dynamic drop down list for an INSERT page. My page is based on this example from mysql.com.

I want to populate the list from a table in MySQL, but when I test the page the list only contains the first record. If anyone can help me out, or recommend an easy way to create dynamic menus/lists, I will be very grateful.

This code appears above the FORM ACTION:

$NearMajorCity = mysql_query("SELECT NearMajorCity_ID, NearMajorCity FROM NearMajorCity");

This code is within the FORM:

<SELECT NAME="NearMajorCity" SIZE=1>
<OPTION SELECTED VALUE="">Select One
<OPTION VALUE="">---------
<?php
while ($NearMajorCity = mysql_fetch_array($NearMajorCity)) {
$NearMajorCity_ID = $NearMajorCity["NearMajorCity_ID"];
$NearMajorCity = $NearMajorCity["NearMajorCity"];
echo("<OPTION VALUE='$NearMajorCity_ID'>$NearMajorCity
");
}
?>
</SELECT>

I want to be able to view the names of the Major Cities in the list, but I want the NearMajorCity_ID inserted into the table.

View Replies !
Delete Textfile List From MySQL Table
I have a list of email addresses that I need to delete from my database and they are in a textfile, one on each line like below...

a@b.com
c@d.com
e@f.com

etc. does anybody have a snippet of PHP code that I could use to accomplish such a task?

View Replies !
List Db Results Vertically In 2-column Table
i'd like to display mysql query results in a two column table, however, with the results displaying vertically starting in column 1 then continuing into column 2.

View Replies !
Create An Array From A List Of IDs Within A Database Table
I need to create an array from a list of IDs within a database table. The table consists of 3 fileds, a unique ID, a user ID and the last is an int value (item number)

eg
1 3 7
2 4 5
3 3 2
etc...

How would I go about using this query

$query1=mysql_query("SELECT itemnumber FROM table WHERE userid = '{$user}'");

Would i be right in thinking I can use:
$array = mysql_fetch_array($query1);

to store all the item numbers associated with the user specified in the first query?

View Replies !
List Box - Automatically Load From A Mysql Table
i have a form with a drop down menu on it where the user can select a team from a list. how do i get this list to be automatically on page load from a mysql table called teams on the page load? I have tried several things before but i always seem to get the php code just appearing on the page rather than going off and processing the code. and i have used the <?php ?> tags.

View Replies !
List Of Sql Query Results Into Table Cells
I would like to know how to arrange a list of sql query results into a 3-column (i.e. 3-cell) table, such that they read alphabetically going down column 1, then column2, etc. So far I have only found advice for arranging values across table columns. Here's the code I'm currently using (single-cell table):

echo '<table class="catlist"><tr><td>'
while ($row = mysql_fetch_array($result)) {
echo '<a href="list.php?no=',$row['id'],'">',$row['category'],'</a> <font size="-1">[Fics: x]</font><br>'
}
echo '</td></tr></table>'

View Replies !
Must Database Table Be Called Up For Dependent List Box Form?
I want to produce a form which will post selections named size and drive to to a file blindsize.php. Looking around this forum and the web, it seems that the only way to do this is to set up a database table (I would set up one in MySQL) and call up that with javacript.

If setting up a MySQL table is the answer, then I would probably use this script. But as I am also new to javascript, I would now have a further learning curve with that, though at first glance the script tutorial looks very good.

But is setting up a database table the only way for a php user? When I first started looking around, I had though the way might be a series of elseif lines.

View Replies !
Select From Drop List To Fill Table Column With Text -- HOW ?
I want viewers to compare state laws on a single subject.

Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the column below.
The viewer can select states from the drop down lists above the other two
columns as well. If the viewer selects only one, only one column fills. If
the viewer selects two states, two columns fill. Etc.

I could, if appropriate, have a separate htm page with the text for each
state -- california.htm for example. When the viewer selects California from
the drop down list, the column below would "fill" with California.htm.

Or, I could conceivably use a text or mysql database with two fields for
each record: state_name and law_text -- but it would probably be easier to
use separate htm files, since there will only be about 20 states involved,
and the "database" would never have a large number of records.

The table width would be 100% and each cell would be @33%

My site is designed with FP 2002 and runs on Apache/FreeBSD. I have just had
Apache-ASP installed but I have not yet configured or used the module.

View Replies !
Is There An Authentic List Or Database Table For States(usa) And Provinces(canada)?
Is there an authentic list or database table for states(usa) and provinces(canada)?

I need it to make a drop down menu for the state/province information for a e-commerce site which only do business in USA and Canada?

View Replies !
Populate A Drop Down Box With A List Of Managers In A Table Called Employees.
I am trying to populate a drop down box with a list of managers in a table called Employees. Table structure is like this:

ID, Employee_name, extension, manager

now the manager could have 10-15 employees, but I pulled a query that would just select the distinct managers. I am trying to populate the drop down list with the managers from the table this is what I have: Code:

View Replies !
List Dir / List Files
Is there a fast way to read files/directory recursively? Instead of inspecting each file(s)/dir(s), is there a way to know that its a file or a directory from its hidden attribut both for windows or unix filesystem?

View Replies !
List To Populate Another List
i have a form with 3 dropdown list. the first is for a canditate, 2nd is for party, 3rd is for state and 4th is for the local areas in the state. I want if the user selects a state, the dropdown list for the local area to be populated automatically. But since they are on the same form i am not sure how.here is my code

<td><select name="state" tabindex="3">
<?php #this is to get listing for roles in a drop dowm menu
#the sql query
$sql1 = "SELECT distinct(state_name) FROM state order by state_name ";
#execute query
$rs1 = mysql_query($sql1, $myConn) or die ("could not execute query $sql");

if ($rs1){
while ($row1 = mysql_fetch_array ($rs1)){
echo("<option>" . $row1['state_name'] . "</option>");
}
}
......................

View Replies !
Update Private Messages Table
I'm getting nowhere with my codes. I've coded a private message system for my site, but the problem is, it doesn't update the MySQL database with "set read = 1 where id =bla". When someone clicks the "read message" button, it'll go to a different page, with this code on top: Code:

View Replies !
Using List
when my form is loaded i populate a list with a database query. now when user selects a value from the list. on "onChange" another query runs and other fields on the form are populated according to the value selected by the user but at this time when page is loaded again and the fields on the form are filld. every thing goes write but the select list doesn't have the same value selected that was selected by the user...the selected list shows the default valuse selected instead.

i want to know that how can we do this that when we select a value from the list and page is populated using this vale and refreshed then again i want to see the selected value in the list box not the dafault value.

View Replies !
Mp3 List
I can't figure why I can't list only mp3 files with this code :

<?php
$dir = opendir(".");
while($file = readdir($dir)) {
$ext = getFileExtension($file);
if ($ext = "mp3") {
echo "<a href=" .$file.">".$file;
echo "<p>";
}
}
closedir($dir);

function getFileExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}

?>

View Replies !
Mp3 XML List
I have an mp3 player for my site. Now I still have to make an upload script but I am wondering something. How would I go about making the scritp write the needed information to the playlist.xml file? So for instance a member uploads a file called "Cowboys_from_hell.mp3" how would I insert this info to the play list?

<track>
<title>Cowboys From Hell</title>
<creator>Pantera</creator>
<location>cowboys_from_hell.mp3</location>
</track>

The tags are already in the playlist so I just need to insert the data between the tags.
I have never done anything with xml or saving info to files so this is new to me. Maybe this is even a db thing to, i dont know. if it helps any i am using the jw_mp3_player.

View Replies !
List Box
i know its possible using php to create a list box populated from a database and this i have done in the past. What i want to do now is:

I have records that have colour options in a single field seperated by a comma eg red,yellow,green,blue What i want to do is add each of those colours into a list box using php pulling that data from the db. These colours are different for each record in the db and are all in one field. Is this doable?


View Replies !
Get Tag List
I want to creat Tag list shown in below web site.

http://www.technorati.com/tags/

Can anybody tell me how to write code for this.

View Replies !
Php List
Code:

function showlist()
{
global $db_table_files,
$db_files_link_url,
$db_files_link_total,
$db_files_link_date,
$db_files_id;

$result=mysql_query("SELECT * FROM `$db_table_files` order by '$db_files_link_date' desc limit 10 ");
echo mysql_error();


View Replies !
Get Dir List
Code:

<?php

$real_path = realpath("test/");
$d = dir($real_path);
while (false !== ($entry = $d->read()))
{
if($entry != "." && $entry != "..")
{
echo "<a href="$entry">$entry</a>
";
}
}
$d->close();


View Replies !
List()
I have a question about the list() function that I could not find on php.net; I am using the following code: PHP Code:

$query = "SELECT blog_id, title, entry, DATE_FORMAT(date_entered, '%M %e, %Y') AS formatted_date
                                  FROM blog_entries ORDER BY blog_id DESC LIMIT 3";
                        if ($r = mysql_query ($query))  // Run the query.
                        {
                            // Retrieve and print every record.
                            while ($row = mysql_fetch_array ($r))
                            {list($id, $title, $entry, $date) = $row;
                                //$date = date("F d, Y");
                                $title      = htmlspecialchars($title);
                                $title2     = trim(strtolower(str_replace(' ', '-', $title)));
                                $entry      = nl2br($entry);
                                $cut        = substr($entry, 0, 300);
                                $new_text   = substr($cut, 0, strrpos($cut, ' '));
                                echo "<h2>{$title}</h2>{$date}<br />

View Replies !
Buddy List
I have a community, now it´s time to upgrade and make a buddy list. Ive started wtih the file that ask´s the other member for a relation. The code looks like this PHP Code:

View Replies !
Problems With List()
I am having some problems with the list() function. Here is some code:

<?

$USERDB = fopen("users.db", "r");

while ($line = fgets ($USERDB, 4096))
{
list ($name, $occupation, $favcolor) = split ("|", $line);

print ("Name: $name<br>");
print ("Job: $occupation<br>");
print ("Favorite Color: $favcolor<br>");
}

fclose ($USERDB);

?>

And here is whats in the text file: Van Tate|Software Engineer|Green

Now...when I execute the script I get this error: Warning: bad regular expression for split() in /var/www/html/v2/getusers.php on line 7.

View Replies !
List Constants
A little embarrassing but: is there any easy way to echo (the name and
value of ) all defined constants?

View Replies !
Loop Through A List
I want to loop through a list and display it in a table with three columns per row, yet haven't had much luck in doing so. I was thinking if would be something like so Quote:

for ($x = 0; $x < mysql_num_rows($query); $x++) {
if ($x / 3) { ?>
<tr> <? } ?><td> Blah </td></tr></table>

Well, that's as much as I know so far.

View Replies !
Add Number In List
I am outputing a list of 10 values.

10, 20, 30, 40, etc

I can add 15 to one of the values then reorder the values from smallest
to highest but i want to update every single value and assign it values
increamenting by 10

so after the update the second number of 20 and add 15 I get

10, 30, 35, 40

now i want to re output the values above as

10, 20, 30, 40

View Replies !
PHP Link List
On a page from Thredz (http://www.thredziii.com) I saw a script (it's not on anymore...cause he didn't want the script to be on his page) and I love it...

It's a script that makes it possible that on a page links are sorted ALPHABETICALLY with the first letter of the "URL name"... (take a look on Thredz' site to c what I mean,K?)

Then people got 2 have the abbility to fill in a small form, ON THE SAME PAGE WHERE THE LINKS ARE ON, where they fill in 2 fields;
#1 = Name of the Site ($sitename)
#2 = URL of the site ($url)

When they fill out it form I want the PHP-script to put the information away as a link (in a *.txt-file...if possible)
<A href="$url" target="_blank">"$sitename"</A><br>
(something like this??? I'm not sure......)
These links have to be sorted alphabetically (on the site's name,$sitename...

I don't know how this works or how I have to make something like this... Could somebody please help me and give me a bit of help with it? Some explaining would be gr8 but the script written for me is the best wish I have.

View Replies !
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:

View Replies !
Getting List Of Newsgroups Via Php
I am trying to write a PHP script that will download a list of all
the newsgroups on a news server and put them into a MySQL database.
I bought a $50 book that had some NNTP examples in it, but none of
them show how to just download the groups, not the articles. I tried
on my own for about 2 hours with no luck. If someone can point me in
the right direction to download the group list using PHP, I think I
can figure out how to write it to a database.

View Replies !
FTP List Problem
I used ftp_rawlist, not ftp_list.
[color=blue]
> I used ftp_list and ftp_nlist. Both of them worked when the target is Sun
> or Linux machine. However, it didn't work when the destination is VXWorks
> (embedded platform). The version of php I am using is 4.3.2. According[/color]
to[color=blue]
> my search on google that problems for ftp_list and ftp_nlist for some
> platforms were fixed in 4.3.
>
> If I manually ftp to the VXWorks, I could use the "dir" or "ls" to see the
> listing at the destination.
>[/color]

View Replies !
List Certain Files In A Dir
I am working on a news script were my members can post what they are currently working on. I have a dir were all of there images are going to be uploaded, and I need to know if the following is possable to do.

$username = the members name selected from the database
$projname = the projects name selected from the database

What I want to do is select only images with the filename containing the info. The filenames are like this:

TheBlackshinobi_3dmountain_1.jpg
TheBlackshinobi_3dmountain_2.jpg
TheBlackshinobi_3dmountain_3.jpg

View Replies !
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:

View Replies !
PHP Shortand List
Is there a place where I can find a list of all the shorthand/shortcuts in PHP's syntax. IE: $_POST, $counter++, etc? Anyone know?

View Replies !
Getting A List Of Newsgroups With PHP
Does anybody know of a quick and dirty way that I can connect to a news
server, retrieve a list of all newsgroups beginning with alt. (or comp., or
blah., or wibble., doesn't really matter), and also the newsgroup
descriptions, and then dump them all in an html file?

View Replies !
Php Mailing List
Is it possible to implement a mailing list using PHP?. I know I could
maintain a list of emails addresses in a db and send mail to them through my
website, but how can I get true mailing list behaviour where emails are sent
to a particular address (like mailinglist@mydomain.com) and then distributed
to all of the email addresses?.

View Replies !
PHP For A Mailing List
I' trying to develop a mailing list system in php and mysql.

View Replies !
While(list => Checkboxes
I wanted to print out checkboxes for those which are checked when form is being submitted. Whilst, this is my function: PHP Code:

View Replies !
Select List
I'm creating a form that has three select lists. The first one has two values EMAIL and SMS. What I want to do is have the two other select lists (named EMAIL and SMS) work so that if EMAIL is selected only e-mail select list can be altered and vice versa with the SMS.

How can I do this? I know to use disabled in <select> -tag, but how can I check the what the value is (and the value changes) and then act acording to it?

View Replies !
Best Way To List Pages A - Z
I now have my emulator site up and running, no longer html but php! Even my vote script now works, thank for all your input. Now I want to have roms on my site for download, but it's a fair long list so you have to devide in sections a - z or something.

Can this be done in a way to create those pages with php/mysql instead of have to write html files for every emulator roms page from a to z? If anyone have done this before I would like to here what the possibilties are.

View Replies !
How To Use A Value From A Pick List?
I'd like to have a form that does the following:
User picks a site from a dropdown list from a MySQL db (that works -
code below, thanks to all those on the web who posted code for this).
Once the value is selected, a second query is run using the site as the
'where' clause and the results are displayed back to the user.

mysql, php, htlm noob. I think once I get this bit,
I'll be able to move forward with more interesting and complex code.

ps - if this message shows up 3 times, my apologies but I've been having
trouble posting.

<html>
<body>
<?php

// connect to db
$db = mysql_connect("localhost");
mysql_select_db("test",$db);

// build query
$sitequery = "SELECT site from sitedata order by site";

// generate result set
$siteresult = mysql_query($sitequery);

// use results
echo "Select a site from the list below: <br><br><select name='site'>";
while($siterow = mysql_fetch_array($siteresult))
echo "<option
value='".$siterow["site"]."'>".$siterow["site"]."</option>";
echo "</select></td>";
?>

</body>
</html>

View Replies !
Css List Navigation
I found a nice link about CSS liquid layout. Specially for css list navigation ....

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved