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.





Show Records That Do Not Match


Table1: account, description, reason
Table2: account, name, address, city, state, zip

I want to be able to show all accounts from Table1 that are not listed in Table2.




View Complete Forum Thread with Replies

Related Forum Messages:
Show First 10 Records, Then Show The Rest
Is it possible to show a fixed number of rows in a repeat region, then show all the rest?

What I mean is - I've got between 40 and 50 records in a database and it's easy to show them 10 at a time. But what I'd like to do is show the first 10, then show all the rest in one go. Code:

View Replies !
Finding Only Records That Don't Match
I have a MySQL query that is supposed to pull records from a 'links' database. In the website, users can vote on links so I register a vote in a vote table with a link id and a user id. I need a way to pull all links that do not have a matching record in the vote table that has a specific user_id. Code:

SELECT *
FROM links, votes
WHERE votes.link_id = links.id
AND votes.user_id != 1

The problem is that there may be several records in the vote table for a single link_id. If user 1 has voted on link 800, and so has user 2, then this query will still pull link 800 because it finds a record in votes where the user_id is not 1. How can I change it so that NO records from the links table are pulled if the votes table has a record for the link_id and the user_id? If user 1 has voted on link 800 then I want to completely ignore link 800. If user 1 has not voted on 800 then I want to pull link 800.

View Replies !
To Show Entries That Match Over Two Categories In Wiki
I'm trying to enable users to search any entries that match a few categories in mediawiki. I just don't know how.

For example, if someone looks up a singer who is in [[cateogry:male]], [[category:born in 1971]], [[Category:Rap]], what should I do to show all entries in Mediawiki that matches these categories?

View Replies !
Do A DELETE Statement To Remove Any Records That Don`t Match.
I`m just trying to figure out the best method to delete my records and wondered if it was possible to do a DELETE statement to remove any records that don`t match. Here is my code so far:

$Query="select blah its huge:-)";
$RESULT=mysql_query($Query);
$my_rows=mysql_num_rows($RESULT);

for ($a=0; $a<$my_rows; $a++){
mysql_data_seek($RESULT, $a);
$Array = mysql_fetch_array($RESULT);
printf("%s<BR>", $Array['Email']);}

My Query returns Matched Records, what I would like to achieve is deletion of the records that didn`t match, would it be possible to do that under the printf statement. So delete all the records in the table that don`t match up to $Array['Email']??

View Replies !
Show Records In Different DBs
I am trying to show how many records are in each db. I have generated a list of dbs using this: PHP Code:

$result = mysql_query("SHOW tables", $db);
while($row = mysql_fetch_row($result)){
    echo $row[0];
}

This works perfectly and I want to add the number of records in each db displayed next to the db name. And I would even like to add a field value if I can. I definitely need some direction on this. Code:

View Replies !
Show Everything Except For Records
I'm trying to display the content added to the database from the beginning of time until "yesterday" (or the day before). This is what I have so far and it returns a general error.

$sql = "SELECT video.id, title, description_text, category_text, level_text, user_name,
DATE_FORMAT(date, '%M %D, %Y') as date FROM video,
registered_users WHERE video.user_id = registered_users.id,
(TO_DAYS(NOW()) - TO_DAYS(DATE_FORMAT(created,'%M %D %Y'))) < 2, ORDER BY id DESC";

Is there a better way to do this?

View Replies !
Show Only Those Records That Are Unique
I am trying to query data and most of the process is going well. I have an HTML logon form which posts data to this php script which authnticates the user.

// query to authenticate user
$sql = "SELECT ClientNo FROM users WHERE username='$username' and password='$password'";
$result = mysql_query($sql)or die ("Unable to get results.");

This authnticates a user to the database and works fine. But now I need to show only those records that are unique to the ClientNo from the first script. I am using another query to try and do this and this is as far as I can get Code:

View Replies !
Show All Records Greater Than 500.
I need to find out how to show all SQL records with a record id greater than 500 can anybody help me out?

I have tried WHERE id > 500 and it doesnt work

View Replies !
Show Records 5-8 Inclusive?
I've got the following code:

$query = ("SELECT news_id, category, title, text, img_url, linkto, DATE_FORMAT(date,'%d %M, %Y') as sd FROM news_posts ORDER BY date DESC LIMIT 4") or DIE ("Can't retrieve");
showing the latest four posts by date.

Elsewhere in the site I'd like to show the next four (ie posts 5,6,7,8 )

Can anyone show me how my SQL can be modified to do this?

View Replies !
Show DB Result Records
i run a query which hava a lot of records when this query run after a long time i see all these records at once. But i need here it show records page by page (mean i can't want to wait with no data page for a long time). In ASP i use a method name flush i also check in PHP i got method flush but i search in this page and don't got solution of my problem.

View Replies !
Show All Records From Database
How to show all records from database. (i mean row by row).for my code, i can only show the last record.

$query = "SELECT * FROM tblpatient";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
while ($row = mysql_fetch_assoc($result)){
echo $row['Name'];
echo '<br/>'
echo $row['Address'];
}

View Replies !
Show All Records For The Selected Month & Day
I have a query that shows all appointments of a chosen day using the following format:

$eventid=2007-05-21

WHERE starttime LIKE '".$eventid."%'

I have a calendar and am trying to make it show all records for the selected month, or display all records from a specific day if a day is selected from the calendar.

So far I have it where I can show records from specific day, but want selected months records as default.

View Replies !
Show The First 30 Records In Reverse Order
I have a table like this:
+-----------+-----------------------+
|   item id    |   item                        |
+-----------+-----------------------+
|      1         |       blah1                   |
|      2         |       blah2                   |
|      3         |       blah3                   |
|      4         |       blah4                   |
+-----------+-----------------------+

Awful diagram, sorry. Anyways, say this table goes on for, say, 60 records. Now, how do I show the first 30 records in reverse order. So, it would look like this:

blah30
blah29
blah28
blah27
blah26
blah25

etc. until it reached blah1. How do I do this?

View Replies !
Show Page Break In Records
I've just started to learn php and sql, and I noticed that there are
several php discussion groups here. Pardon me if this is the wrong
group, and I hope my first question isn't too silly. :-)

I'm building a website that will publish articles, so I have an
article table which contains a heading field, an ingress field, and a
body field which will hold the complete article. There are line shifts
(or page breaks) in this field, but my display-page won't show them.
How do I show the article with the page breaks?

View Replies !
Show Number Of Records Held
I want to display the numbers of records shown in each County on my database. PHP Code:

mysql_connect($host,$username,$password);
mysql_select_db($database) or die( "Unable to select database");

$query="SELECT county 'Bedfordshire', 'Berkshire' FROM t_data";
$result=mysql_query($query);
$num=mysql_num_rows($result);

while ($row = mysql_fetch_array($result)) {

$Bedfordshire = $row["Bedfordshire"];
$Berkshire = $row["Berkshire"];

}

How dow I show the number of records on Bedfordshire, Berkshire etc. I am echo'ing $Bedfordshire which shows the data not the number of Bedfordshire records held.

View Replies !
Looping Through Records(show First Record And Then Loop)
I am trying to display the first record seperately before looping through the rest of the records in the mysql array. PHP Code:

View Replies !
Showing Database Records As Links To A Page To Show Relevant Detail
What I currently have is list of players what I want to do is make each player a hyperlink to a page with their details on. The hyperlink would be like this www.mydomain.com/playerDetails.php?playerID=1 and it would display the player with playerID 1. I have seen this on lots of sites and would like to know how this is done, can anybody recommend me any tutorials or write me a short script to do this.

View Replies !
Regular Expression :: Match A Word, Not To Match If It Contains Certain Surrounding Text
I need to look to see if it appears in a page, but not count its appearance in the page footer. How can I match a word, and specify not to match if it contains certain surrounding text? EG:

I want to match "foo", but not when the match is "only by foo".

I tried a few derivations of /[^o^n^l^y ^b^y] (f|F)oo/, but if the last letter of the previous word matches any of those letters, it doesn't work.

View Replies !
Match Array Key To Query Match
I have an array that I output through a loop. It's a list of states. Now I need to run a query ona table and if I find any results associated with this state in db mark this table with, say <strong>State</strong> tags. Having difficulties figuring it out. I'd hate to run a query 50 times to get the results. There's gotta be a better way.

View Replies !
Checkboxes - Show A Tick In The Boxes To Show That They Have Already Been Added.
I have been trying to learn checkboxes and arrays, and I've finally figured out how to add the checkboxes to the database.

I currently have two forms  addlinks.php and modifylinks.php and I have a dolinks.php that submits my data to the database.

What I would like to do now is on my modifylinks page show a tick in the boxes to show that they have already been added.

At the moment if I dont tick any boxes on modifylinks.php it deletes my previous data, and I have to retick them everytime I do an update. Code:

View Replies !
Preg Match To Match A Url
Trying to use preg_match to match the following form http://www.example.com/user-45...what am i doing wrong?

preg_match("/^http[://]+[www]+.[a-z0-9-_]+.[a-z.]{2,6}+[/a-z0-9-_]$/i",$_POST['url'])

View Replies !
Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:

View Replies !
Displaying Multiple Records And Want To Be Able To Update These Records With Different Values.
I am creating a page where I am displaying multiple records and want to be able to update these records with different values.

View Replies !
DELETE RECORDS - Database Adding New Records
iv got the database adding new records, and now I want it to display all of the records that are there buy name and id number, then i want u to be able to type in the id number of the customer u wish to delete and it shoudl delete it, sounds good buts its not actually deleting the record. it says it does, but its not doing it. Code:

View Replies !
Problems With The Listing Of Records, Editing Of Records
I'm having problems with the listing of records, editing of records, and deleting of records. I'm not sure what I'm doing wrong.

The listing script is calling the add entry script. So I add the record, the database is updated, and nothing else happens. I don't get a list of records from that table.

When I did SQL programming off the mainframe, you did a simple select statement. I'm not sure why the PHP list script is calling the add entry script. Code:

View Replies !
Code To Show Slide Show In PHP
Can anyone guide me as to how can i display a slideshow of all the images present in an album and if possible the code.

View Replies !
Show Table Only If There Is Data To Show?
I have a table that shows specific data (via a while loop)

however, when you first log in as a new user, you see the table column headers but there is obviously no data, and it looks a bit unsightly.

How could i take this code:

View Replies !
MySQL 'SHOW TABLES' Doesn't Show Temporary Tables?
I have a function call which creates a temporary table in MySQL, and then a second function call which operates on that temporary table.

I was hoping to do something like this in the second function call to ensure that the table was in fact actually created:

if (mysql_num_rows(mysql_query("SHOW TABLES LIKE 'my temp table name'")))
// do something
else
//error

However, apparently the MySQL SHOW TABLES statement doesn't show temporary tables. Is there another query that I can use to show temporary MySQL tables so I can do this check?

View Replies !
PDF Mix & Match
I was wondering if anyone had any experience of splitting & appending PDF's?

A client has a huge pdf, and he wants to give the user the ability to mix and match the chapters that they want to download. The final final will be 1 pdf, but may consist of various different chapters chosen from a list. The chapters will be ripped from 1 master pdf.

Oh, and the PDF is not just text it contains all manner of images,links & the like!

And that is what is required. I was wondering if anyone had any pointers regarding this? I'm thinking PDFLib, but I haven't fully looked into it yet.

View Replies !
Match Only Three
I have this code:
$numbers = array("04","13","18","21","30","46","(05)");

foreach($data as $key => $value)
{
if($data[$key][5] == $numbers[0] && $data[$key][6] == $numbers[1] && $data[$key][7] == $numbers[2] && $data[$key][8] == $numbers[3] && $data[$key][9] == $numbers[4] && $data[$key][10] == $numbers[5] && $data[$key][11] == $numbers[6] )//did they win the jackpot?
{
echo "You have Won!<br /><br />";
}
else
{
echo "You did not win this time :(<br /><br />";
}
}
The above code will check the $data[$key] array and match the values against the values in the $number array. That is fine. However what if I wanted to see if only 3 values in the $numbers array matched the numbers in the $data[$key] array. How would I do that?

View Replies !
Where Match () Against ()
i would like to change the following line

WHERE MATCH (artists.artist) AGAINST ('$id')

to

WHERE DOESN'T MATCH (artists.artist) AGAINST ('$id')

ie i would like to show all results where $id does not occure.

View Replies !
Match Against
I want use a match against in search engine on multiple tables. In other term I want to create an index and fulltext across 2 tables.

View Replies !
PHP Pattern Match
I need to convert the following pattern which I found in a php program into a perl regex... but I have NO CLUE WHAT IT DOES!

&[^;];

<[^>]*>

Actually, for the second one, I have an idea as to what it does, but I'm not sure... they are both used in this context:

View Replies !
Run SQL With Value Match To $array
I wonder if it is possible to do "select" in mySQL database with value matching to an $array.

For example,

$array = array("shanghai", "beijing");

I want to select cities whose names match the values in $array.

Instead of using foreach(), is it possible to do the select with the array itself. I know some languages support this function. For example:

SELECT fieldname FROM cities
WHERE city_name in '$array'

Is it possible in PHP with MySQL?

View Replies !
How To Get The Match Score
I own a sms site and wants to update the users with the cricket match score.
I think i need some sort of xml feeds.

View Replies !
Regex: How Do I Match A Dot?
I am trying to match the dot, so that it actually matches "a dot" and not "everything". How do I write that? Example: the word "st."

I have tried
'/st./i'
'/st./i'

Sorry if this question is noobish. I have not been able to find the answer searching the net.

View Replies !
While Query Only Does First Match
I'm generating letters based on the date a lead was entered into the database. I've tried moving the } into several places. If I move it before the 2nd query I get all the letters but no dealers. If I move it to the bottom (as it now) I get 1 letter with the dealers. I can't figure out what to do to make the query generate all the letters with their associated dealers. PHP Code:

View Replies !
Trying To Match Date..
I am trying to make an Order History Lookup page for an E-commerce site. Now.. when an order is submitted the dateinserted is formated as date("U") and stored in the Db table.
Now.. when I create the lookup date formfields I have them as such:

Month (02)
Day (25)
Year (02)

How would I go about getting these values so that I can compare exactly against the date("U") string that is stored in the DB?

View Replies !
Regex - How To Match Until Something
How do you replace an occurence until a certain point: You can see my
example code below and the output:

$string1 = 'Hello world today'
$string2 = 'Hello blahblah'

$string1 = preg_replace ( '/Hello.*(?!today)/', 'Hello ***' , $string1
);
$string2 = preg_replace ( '/Hello.*(?!today)/', 'Hello ***' , $string2
);

echo "$string1 - This should be Hello *** today
";
echo "$string2 - This is correct
";

Outputs:
======
Hello *** - This should be Hello *** today
Hello *** - This is correct

View Replies !
Match Any Character But
Can I use any reg exp(mainly for mod rewrite) where I can match any
character but a fixed list?

I need to match a string that does not contain any /'s but I don't want to
have to use a character search string. (I don't see any need to have to
hardcode it)

that is,

..

matches any single charactr

and (.*) matches any string

what I want to do is use something like % that means

..%/

which means match any character but /.

Of course it would need to be valid and I know I can't make up semantics for
the reg ex. My point is is that, is that I don't want to have to use
[a-z0-9-%&^$#@!etc...] to mean . but not /.

Surely there is a way to exclude a few characters from . without having to
increase the complexity of the expression 1000 fold?

If you don't get that, then a simple example would be that I have an
arbitrary string and I want to match only if that string does not contain an
a. Sure I can so something like
[bcdefghijklmnopqrstuv1234567890!@#$%^&*()_+]['/.,<>?:"{}+-=~`..........................]
but surely reg exp has an easier way??? (again, this is specifically for mod
rewrite)




View Replies !
Regex: Before And After The Match
I want to match a table and also capture the parts before and after the
table:
preg_match_all("|(.*)(<table.*table>)(.*)|",$text, $parts);
But of course it doesn't work, presumably because the first .* is
greedy. I tried adding an ? but that doesn't work either. How do I do
this ?

View Replies !
Php Emails Do Not Match ??
i have created a registration script for my website and i have added a new featurer that makes you enter your email address twice and then it is supposed to check if they are the same  and then if they are submit the form but if not show an error but even if the email addresses are the same it still shows the error below is the code for the email checking Code:

View Replies !
Match Title
I am trying to get a the title out of a html page, I have the html code loaded into a variable. The only thing is sometimes the title is not on the same line.

<title>need this text</title>

$title = preg_match(/<title>s</title>/i, $html);

help me with this match syntax?

View Replies !
Match Number
below is my code it is no working as I thought it would though, I get no errors but when I try to echo out $arr_chk_privacy to see what it says it just shows "array"

PHP Code:

$arr_chk_privacy = $_POST['chk_privacy'];
    $cnt_chk_privacy = count($arr_chk_privacy);
    if ($cnt_chk_privacy > 0) {
        if (in_array(3, $arr_chk_privacy, true)) {
            $_SESSION['hideonline'] = 1; //hide online status
            $sql_delete="DELETE FROM friend_online WHERE userid='$info[auto_id]'";//delete from online table
            executeQuery($sql_delete);
        }else{
            $_SESSION['hideonline'] = 0; //show online status
        }
        $chk_privacy_ids = implode(",", $arr_chk_privacy);
    }

View Replies !
Pattern Match
Where can I find infi or doc on "pattern match" used within WHERE clause (mysql). As I need to matche with PHP variables I'd prfer something adapted to PHP. In "PHP&MySQL Web Devlpt" (Luke Welling) I can't see much.

View Replies !
FULLTEXT Match Against
I have a fulltext column that contains many word, I am passing $search to it which has 3 words in it currently it finds all entries containing the 3 words but lists entries that also have one or 2 of the words here is my mysql request
mysql_query("SELECT * FROM addresses WHERE MATCH(title) AGAINST('$search')")

How do I get it ot only show entries which contain all 3 words only?

View Replies !
MySQL WHERE MATCH
I have the following table

CREATE TABLE `fulltext_sample` (
`copy` text,
FULLTEXT KEY `copy` (`copy`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `fulltext_sample` VALUES ('This is a test to see how mysql
works');

Now I do a search for SELECT * FROM fulltext_sample WHERE MATCH(copy) AGAINST('mysql');
and it return 0 results. Can someone please help me with this?

View Replies !
Events Match
I have events recorder in db with the following type date format: 2005-05-31. How do I select the ones that are of this month?

View Replies !
Match An Array
i have this array

$ary = array(
"Today date is 1, our breakfast is 2 eggs and salad",
"Today date is 13, our breakfast is 3 breads and beff",
"Today date is 18, our breakfast is 2 toasts with egg",
"Today date is 21, our breakfast is 5 wafels with honey",
"Today date is 30, our breakfast is a bowl of sereal"
);

i need to search and match the date (that i have bolded it) and then compare it to today date using this fuction date("j"); to find the date in the string i'm using this regex ([1-3][0-9]?)(?=, our). i have try everything but i cannot solve it so in the end, if today date is 18 i want to display only this string. Today date is 18, our breakfast is 2 toasts with egg can i do this?

View Replies !
Match A DB Entry
I need a way to match in the DB every entry in a row that has &#391;/' at the beginning but it needs to only be &#391;/' so entries that have &#3915;/1/' should not be matched

View Replies !
Preg Match?
I'm trying to work on this basic preg_match that gets the </a> tag. For some reason, it doesn't work. preg_match('/(</a>)/i',$string,$match);

View Replies !
Difference Between WHERE LIKE And MATCH
I'm writing a search query using keywords - at the moment the search uses FULLTEXT fields and looks like this :

"SELECT *, MATCH (".$fields.") AGAINST ('".$searchKey."') AS score FROM products WHERE MATCH (".$fields.") AGAINST ('".$searchKey."')"

using that query i get the results in order of pertinence BUT as far as i can tell i can't use the '%' wildcard for searching with MATCH - is that correct ?

if I want to use wildcard searching it seems i have to use

SELECT * FROM prducts WHERE LIKE %bla%

but, as far as i can tell, i don't get the results in order of pertinence

so - is there a way of using wildcard matching but still getting the results in order of pertinence ?

View Replies !

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