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.





Can I Put A Cap On The Number Of Records Added?


This one is a new one for me. Is it possible to limit the number of records any one "member" is able to add to the MySQL db?

In other words, basic members are entitled to add 50 items, but premlium members 100 items.




View Complete Forum Thread with Replies

Related Forum Messages:
Number Of Records
I want to find out how many records, but I am using LIMIT in mySQL so if set the limit to 20 and I have 56 records then it will display 20 instead of 56.

I have been using:
mysql_num_rows

What should I be using?

View Replies !
Counting Number Of Records
I am trying to do 2 things. First, i want to count all the records that i get when i query the db. Second i want run a loop to display all of the info.

The loop works fine, (it displays all the results) but when i try to count the records, it only echo's 1. Here is the code i'm using. PHP Code:

View Replies !
Finding Number Of Records
I'm attempting to query a database to find out how many occurances of a particular value exist. So I'm trying to select where the same VendorNumber occurs less than twice, or more than twice. If it only occurs twice I do not care. I would like to also be able to see what the Value of the VendorNumber is. I've tried various syntax with count, distinct, and having, but I'm not sure I understand how it all works. In brief, I have a table called Vendor, which has the following entries for the VendorNumber field:

123123
123456
123456
123789
123789
123789

I'd like the query to tell me there is 1 occurance of less than 2, and there is 1 occurance of more than 2. It would be fine if these are separated out into two different queries to put into a php page. I'd also like to see the VendorNumber displayed.

View Replies !
Count Number Of Records More Than Zero
I would like to check if the number of records is more than zero. $sql = "SELECT count(*) FROM Hardware WHERE Location = '$location'"; how to continue from the above statement?

View Replies !
Limiting Number Of Records
I was wanting to find out how to limit the number of records displayed from a text file. Is there a way to limit the number of lines read from the text file?

View Replies !
Adding A Number To All Records
is there a query structure that will enable me to add, say, 10 to all records in a certain column without doing 2 queries for each record (one to get the current value and one to update it with the new value.

View Replies !
Counting The Number Of Records In Table
I want to count the number of records which apply to a repeating id field. (the user id remains the same, but their are several records which relate to the user. I want to know how many records in the table exist for a specified user id) Does anyone know a function for doing this?

View Replies !
Display Number Of Records Into Pages
we are using oracle database, Oracle Select statement is not supporting the LIMIT , Is there any other way to display records into pages.

View Replies !
Count The Number Of Records In A Table
I just want to count the number of records in a table that meet a certain set of conditions: Getting an error: Warning: mysql_result(): supplied argument is not a valid MySQL result resource code:

View Replies !
Counting Number Of Related Records
I have a database which contains a listing of employee names along with the results of completed exams they have done. So each record contains their name and the name of the exam they have completed.

What I'm trying to do is pull out how many exams each employee has done, and then email myself a message when all 15 exams have been completed. Code:

View Replies !
Delete Fixed Number Of Records
i have a table with one field. this field saves times as records. i want to there are 40 recoreds always. in other mean when inserts 41'st record then 1'st record be delete
how to delete fixed number of records at a time of first of my records asc (like select).
in other mean i want to like: delete from table order by time asc limit 0,1

View Replies !
Count Number Of Records Returned
I want to know how many records were returned from a stored procedure.

$rs=odbc_exec($conn,"EXEC select_Contacts ".$sessionID);

I have tried: odbc_num_rows($rs) but it always returns -1 even though records are printed out.

View Replies !
Suffix A Number To Duplicate Records
When querying the DB for records, many of the records have the same name. These names are not really duplicates because they are unique.

For the records returned that have the same name, I would like to suffix a number at the end.

For example:

john01
john02
chris01
chris02
chris03
tom
jack

Btw, I do not want to add the incremented ID, because there are many records, 100,000+ and above. The ID would be too big of a number to add as a suffix.

I need to add the suffix number to the duplicate names and not to the names that do not repeat.

View Replies !
Display Problem (number Of Records)
My company sends out a newsletter displaying new artwork aquisitions- my boss would like to have the number of works that we have by an artist displayed next to their name. Meaning- we show the image- then the artist name and the name of the artwork. He would like for the right number to show up in parenthesis next to the artist name.

We have that displaying in another area (in a drop down search box). When you pull down the box it autopopulates with artists in the database and shows the number next to their name. Code:

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 !
Limiting Number Of Records Stored In Database
Is there a way I can limit the number of records that are stored in a database? I am using a PHP guestbook script for personal use and only want to save say the last 100 messages.

View Replies !
Retrieving And Writing Out A Large Number Of Records
I'm querying a remote mysql database and retieving a large number of records (600K records with about 12 columns for each record) which I am then writing out to a file on the local machine.

I'm having problems with the process timing out, I only get about half of the records, and I'm wondering if there is a better solution then the one I'm using? Either inncreasing the timeout, or better yet by optimizing my code? Mysqldump is not an option for me at this point. Code:

View Replies !
Sending Variable To Display Number Of Records To Write?
Sorry, couldn't come up with any reasonably short subject.

I am sort of new to PHP. I've got an event registration database (MySQL). In it, I have two tables, one for the registrant's info, and one for the reservations. Assuming that one registrant can make more than one reservation.

There are 4 types of registrations. What I would like to do is to have the first page filled out with the registrant info, and have the registrant select the number of each type of reservations he/she would like. These numbers will not be written to the database, but will be used to determine how many of each type of reservation will be shown in the next window. Once the info is submitted (and written to the database), the user will then be taken to another page where they will enter the name for each registration, as well as the entree choice.

so, the question is, how to do that (I will be passing the RegID as the primary key from tblRegistrant to use as the linked field to tblReservations). Ideally, I'd also like some sort of edit button so people don't try to use the back browser button to change their numbers. Any suggestions?

View Replies !
Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

View Replies !
Create Dynamic Table With 3 Columns And Unknown Number Of Records?
I'm trying to create a table with only 3 columns, but the problem is I don't know how many records will populate the table so need it to automatically create <tr> and </tr> tags every 3 records. How best can I do this?

At present the code below just lists every single record in one continuous row - but as I said, I want to only display 3 records per row. Code:

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 !
Added To Zip Archive
I am using winzip to zip up a folder with a load of images for an image gallery upload form. The problem is that there seems to be an extra file added to the archive that is not visible in the folder to be zipped.

The file is thumbs.db I am aware what the file is and what it is for but what i dont understand is why it is being added to the archive when it s not intially visible in the folder to be zipped. This is screwing with my site because flash is trying to load the thumbs.db.

View Replies !
Added Some Headers
I have a site that uses a PHP email form. It has been working fine until recently I added some headers to the mail function. Not it works fine in Firefox but not at all in IE.

View Replies !
Categories Added
when a user logs into my site i wanted to add a "JUST ADDED" sign next to categories uploaded since they last logged in, once they see the new categories the "JUST ADDED" sign dissapears, i'm not sure the best way to go about it and help would be great.

View Replies !
// Being Added To Columns
I have a little sign up form on my website, and when people sign up if they sign up say with a "'" in there name, when I pull the name from the database it come's in as O/'Brien... How do I get rid of this? With strip_tags?

View Replies !
Slashes Getting Added
So, I've got this simple test PHP document (at the bottom of this
message). It simply puts up a textarea and then submits the form to
itself. The text of the textarea will be placed in 'body' of the $_POST
array. If the $_POST['body'] variable is set, it outputs what 'body'
contains and if not, it simply outputs 'No body var'. Code:

View Replies !
Why Is Localhost Added To All My Links ?
Not sure if this is a php, mysql, or apache issue. I use win2k and I
have AMP on my system as a localhost. I use this to test PHP/MYSQL
scripts I write on my local PC.

I render a URL w/PHP by reading the URL string from a mysql field, eg.
on the php web page it shows as eg. www.yahoo.com link

But when I click the link I see that "localhost" is added to the URL
and it goes nowhere. ie. it get localhost added to the front -
localhost/www.yahoo.com

Is there a setting somewhere so that the link is exactly what the link
is and localhost is not added.

View Replies !
How Can I Stop Slashes Being Added At All
I am passing various strings through a php script to then ahve them display as an image (dont ask lol)

I'm using stripslashes(); to avoid any html being entered into the script AND also because some of the strings i'm passing contain the ' char, which gets auto escaped via magic quotes.

Now, i can strip this escape char away with stripslashes, BUT, if the user makes more changes to the phrase... font... colour etc, then each time they click submit more slashes get added.

How can i stop slashes being added at all, maintain security and not go bald through hair pulling?

View Replies !
After Mysql Insertion Another Row Is Added
on the site i am developing i have noticed after a database insertion is made, mysql insert another row (but only the id increments by 1)

if i insert:

id---name---age---country
1 ---Graham---28---Scotland

right after this will be:

2 ---blank---blank---blank

i checked the inserts carefully it all seems fine, then tried LIMIT 1, with the INSERT INTO but that didn't work, any ideas on what this could be?

View Replies !
Session Info Added To URL
I'm noticing that when my homepage first starts up, all the menu links
to other pages have the session info appended to the URL. For example:

href="products/product_list.php?PHPSESSID=45759f8aadee64cff2db657 48977ac67"

This is done automatically as the original URL that I coded does not
have the session information added to it.

My first question is, is this normal behavior? The reason I'm
concerned is I have been tracking the Google Bot's activity on our
site and it hits the homepage and does not crawl the other pages. I'm
concerned the added session info is throwing it off. Code:

View Replies !
Extra Space Is Added
I used the search option but i couldnt get solution for my problem. When i retrieve value from mysql db and place in a textbox an extra space is attached at the end.

View Replies !
SESSIONID Added To Every Link
I've had this problem once before and I can't remember how I fixed it. I remember it was something very simple and silly so I'm hoping someone can jog my memory or even tell me what's going on. Its causing problems with MySQL as well where all my SELECT queries are case sensitive.

All links to other pages have "&PHPSESID=..." appended to them - anyone know how to stop this?

View Replies !
Include With IE - Added Padding?
I am using "include" to enable smoother updating of my menus. In Mozilla Firefox when I include a .php or .txt file with a ul list/menu it works fine, but in IE7 there is additional space at the top of the list shoving it down the page so that it overlaps with other content...

Strange, no? Below are the urls to the included list and the normal html page. I have added the style sheet also, 'coz although this should not be a css issue, it just might be? Code:

View Replies !
Concatenated Variable Added
I would do it with a known amount of IDs would be like this. PHP Code:

$directorid = $_POST['Director']; //the person ordering the work

    $_POST['Contacts'] = array();// Make it an array

foreach ($_POST['Contacts'] as $contact) { //Set the elements in the array
    $Contacts0= $contact[0];
    $Contacts1 = $contact[1];
    $Contacts2 = $contact[2];
    $Contacts3 = $contact[3];

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 !
All I Need Is A Couple Of Lines Added To My Script.
categories table info :

id: unique auto increment
parent_id: all master categories =0
sub categories = id of its master category
name : name of category

The script I've written is supposed to each master category in the table followed immediately by any sub-categories it may have. If a particular master category does not have any subcategories it should fetch the next master category.

My script works fine up to the point where the table contains a few subcategories before the next master category. At this point it lists out the subcategory (which has already been listed earlier within a master category) again assuming that it is a master category.

All I need if an if or while statement in my script. I've tried different variations, but nothing worked.

Here's the script:

View Replies !
Exec Can't Work Even Added Safe_mode_exec_dir
I've downloaded the convert class to convert 3gp, mov, wmv to flv. As
the php file is small, i just posted all the original code at the end
of this message.

My problem is about the exec function in safe mode. I installed xampp
which bundled Apache, PHP and MySQL in Window Server 2003 SR2. I've
added the following entry already in the php.ini file:
safe_mode_exec_dir ="C:Program Filesffmpeg"

The php page run without any error prompted but there isn't any output
file. When I turn off the safe mode, output file appeared. Is there
anything I need to set beside the safe_mode_exec_dir?

View Replies !
No Error Message But No Data Added?
This is my script for uploading binary files and store them in mysql. It runs without error, but no file is added to the db? Anyone with a hint?

Here it goes:

View Replies !
[error] An Unknown Filter Was Not Added: PHP
I'm getting this error in my error_log in apache. Can anyone offer any
assistance in fixing the problem?

I'm using RH 9 with apache 2.0.53 and PHP v4.3.11

[Fri Apr 29 09:32:03 2005] [error] an unknown filter was not added: PHP

.........

View Replies !
How To Get ID For Newly Added Mysql Data
how can I get the id (primary key) for the recently added data from insert query.

View Replies !
How Line Breaks Are Added To Database?
how line breaks are added to database? When a user edits a description and updates database i want line breaks for each time the database is updated. Then i want to be able to show line breaks when a user retrieves the data,

e.g user added stuff on 24/10/05
user added more stuff on 24/10/05
user added even more stuff 25/10/05

rather than:

user added stuff on 24/10/05user added more stuff on 24/10/05user added even more stuff 25/10/05

View Replies !
Variable That Is Added Each Time A Row From The Database
I'm trying to get this so that in a while loop, theres a variable that is added each time a row from the database is present and displayed it adds one too it. now i want it if it's divisible by 2 it will make a new row, here's the code I'm using, it works for if it's divisible by 4.

<?php if (!(($x-1) % 2)) {
echo("</tr>
");
echo("<tr>
");
}?>

View Replies !
Spaces Added When Writing To File
I have a script that reads two numbers (separated by a comma) from a txt file and adds one to one or both of the numbers. It then writes the new numbers back to the file, in the original format.

It works, however, it keeps adding spaces to the beginning of the file. Normally this wouldn't be a major problem, but this file will eventually be modified a lot of times. That could eventually make the file size huge, slowing down the script. Here is the script (there's more to the PHP file, but this is what I'm having trouble with):

// OPEN AND READ THE FILE
$stats_file=fopen($stats_file_name,'r+');
$stats=trim(fread($stats_file,filesize($stats_file_name)));

// PARSE AND ADD 1 WHERE APPROPRIATE
$stats_values=explode(',',$stats);
$stats_values[0]++;
if ($is_unique==true){
$stats_values[1]++;
}

// WRITE NEW STATS TO FILE
$new_stats=trim($stats_values[0].','.$stats_values[1]);
$new_stats=str_replace(' ','',$new_stats);
ftruncate($stats_file,0);
fwrite($stats_file,$new_stats);
fclose($stats_file);

View Replies !
Username Automatically Added To Submission
Basically what i need is a code to check what the username is, and then submit the contents of the form. For example, the user presses submit and the form is emailed to me... but i want their username to be included (because they'll be logged in to have to complete the form).

View Replies !
Backslashes Are Being Added Before Every Single Quote
I am writing a basic PHP news administration system, but am having a little problem. Wherever there is a single quote, a backslash is being added before it. My news system works this way; I have a set of HTML forms on one page that save their contents to a text file using PHP.

I then use PHP to load and reverse the contents of that text file (newest news first) and display (echo) it on the index page. The only problem is, wherever there is a single quote, a backslash is being added right before it. Code:

View Replies !
Exclamation Points Being Added To Email Script?
I'm using an email script that takes form values and passes them to various email addresses depending on a selection choice in the form.

Anyway, I've been getting exclamation points being added at random in the text of the email. For example, one time I'll have a line saying >> Name: Joe Smith City: Ch!cago.

The next time it may show >> Nam!e: Joe Smith City: Chicago or else not include an exclamation point.

Also, if I try to use some simple html tags (eg <b></b>) it will work correctly for a couple lines then the rest of the lines will be bold as if the </b> isn't being read. This is a random thing also as each email has different lines "bolded".

Has anyone come across this type of thing before with using PHP, HTML, and Email?

View Replies !
Searching A Website - Including All New Added Pages
Basically, i need to write a php search function which will search all
our pages in the directory depending on user keywords..

the thing is, this could be difficult as we may have 8000+ dynamic
pages (these would also need searching) plus we will be adding more and
more of these dynamic pages (so wont have a list of page names).

View Replies !
How To Display Newly Added Mysql Column
I have a mysql table and i want the user to add columns using a php
interface and then display the table with the newly added column. I
was thinking about putting all the columns names in a special table
but there must be another more efficient way.

as an example this is my query to display the table:
$result = mysql_query("select * from news");
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$message=$r["message"];
//display the row
echo "$title <br> $message <br>";
}

now if the user alter the table and add a column "rank", how can i
update my query automatically so it can display the newly added row
(or column)?

View Replies !
[error] An Unknown Filter Was Not Added: PHP - Error_log
Anyone know why this message would appear in my error_log. My PHP code
executes fine...but it is outputting this to my error_log and I cannot
figure out why. I've been looking for a couple days...but have not found
any reason/fix on the web for this message. My php.ini and php.conf look
fine.

View Replies !
Escape Characters Added To Form Data
Some characters entered in the text fields of a form get an escape
character. What is the reason? How can I prevent/remove this?

Here is an example:
<form action=hello.php method=post>
<input type=text value=firstname>
</form>

If the user enters:
O'Hara

And I have the following file hello.php:
<? echo $_POST['firstname']; ?>

The output is


View Replies !

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