Jump to content

Trying to create call logging system - need number generator


leachus2002

Recommended Posts

Hi All,

 

I am currently trying to create a web based call logging system, based on a PHP front end and a MSSQL back end. I want to be able to grab the next number in a sequence so that when calls are logged, they are given a reference number. I have throught about using the random number generator in PHP, but there is a slight chance that I will get the same number twice.

 

Is there a way that PHP can read, maybe from a table and use the next available number where a row is not populated?

 

Many Thanks

Matt

Link to comment
Share on other sites

sorry to tell u but i cannot understand what u are asking..

 

if u want to check the rand number

 

<?php

for ($i=1;$i<=1000;$i++)
{
$arr = range('a','z');
$arr1=range('','');
shuffle($arr);
echo implode("", $arr);echo "<br>";
}
?>

 

the odds of getting the same value are astronomical in this one... :P

 

 

Link to comment
Share on other sites

Hi, Apoligies for not making myself clear.

 

What I would like is for when a user is logging a call, then PHP assigns a call number to that call - for example 0001 - but when the next user logs a call, it assigns the next number, 0002 and so on and so on.

 

Does that make sense?

 

Thanks

Matt

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.