Jump to content

_tina_

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Posts posted by _tina_

  1. Still haven't been able to resolve this.  I need, if a user clicks a link, a bd will be quieried and return send the rows to a csv file, which will then present the user with a doownload prompt.  The problem being that when there are 10,000+ records, I get a php memory error.  Is there a way around this at all?

     

    Thanks for the replies so far and thanks for reading :)

  2. Thanks for the reply.

     

    Here is what I am doing:

                $this->setLayout(false);
    
        $q = Doctrine_Query::create()
    	  ->select('*')
    	  ->from('ContestSubmission s')
    	  ->leftJoin('Contest c ON s.id = c.contest_id')
    	  ->where('s.contest_id = ?', $request->getParameter('id'));
    	$this->contest = $q->execute(array(), Doctrine::HYDRATE_ARRAY);	 
    
    
        	$this->getResponse()->setContentType('application/msexcel');
    

     

    This is done using a PHP framework btw.

     

    Regarding memory management, what would you suggest I do to rectify this?

  3. Hi,

     

    I'm trying to export to a csv/xls file.  The user clicks a link, which calls a function that queries the database and prompts them with a download dialog.

     

    I have an array of results, everything works fine, BUT, when I have 8000+ results, I get a PHP memory error.  Is there any way around this?

     

    Thanks in advance!

     

  4. Thanks Teamatomic, yes, this sweepstake is US based. 

     

    AS for coding. Sweeps have a definite start and end date. You also need to determine the entry type, daily, weekly, or once.

     

    Then you need to decide on the entry method. Do users need to preregister or can they just surf in and enter an email addys and continue. One of the things that will determine this is the actual reason for the sweep. Are you merely harvesting addresses for a email campaign or are you trying to gain a user base. Or are you making a revenue producing ad display engine. Those above will determine how tightly you keep registration and entry type.

     

    Next comes, what exactly are you giving away and what is its value. Value is not what you pay for it but its real world retail worth. Along with this is the geographical area to be allowed entry. This determines the rules and regulation that need to be followed.

     

    Before I do a bunch of useless finger work. If you are US based let me know and I can tell you, as IANAL, what you need to be aware of and the pitfalls to stay away from. If you are not US based I cant be of help in the RR area.

     

     

    HTH

    Teamatomic

  5. Hi Teamatomic,

     

    Thank you for the reply. 

     

    I'm actually looking for both.

     

    Thanks!

     

    Are you wanting to know how one works or are you concerned with the regulations?

     

     

    HTH

    Teamatomic

  6. Hi,

     

    I need to write a sweepstakes competition program.  I'm not really sure how a sweepstakes works fully. 

     

    Has anyone got any experience with this? 

     

    Thanks in advance :)

  7. Hi,

     

    Can anyone see what I'm doing wrong in the following code?  My queries are coming back false.

    It connects fine, just the queries return false.

    Thanks in advance.

     

    <?php  
    
    class database
    {
    private $connectlink;	//Database Connection Link
    private $username = "root";
    private $password = "root";
    private $database = "test";
    private $hostname = "localhost";
    private $resultlink; 
    private $rows;	 
    
    public function __construct() {
    $this->connectlink = mysql_connect($this->hostname,$this->username,$this->password);  
    if(!($this->connectlink)) {
    	throw new DatabaseConnectionException("Error Connecting to the Database".mysql_error(),"101");
    }
    else {
    	mysql_select_db($this->database);
    }
    }
    
    public function __destruct() {
    @mysql_close($this->connectlink);
    }
    
    public function query($sql) {
    		$this->resultlink = mysql_query($sql);  
    	return $this->resultlink;
    }
    
    
    }
    
      
    ?>
    

     

    $db = new database();
    
    $sql = "insert into test ( table ) values ( '".$val."' ); ";	 
    	try {
    		$res = $db->query($sql);
    	}
    catch (Exception $ex) {
    	echo "An error has occurred: " . $ex->getMessage();
    }
    
    

  8. Hi,

     

    I have an array of email addresses, I'm trying to figure out how to check for duplicates.

     

    I have read various form posts on the topic but can't seem to get anything that works for me.  Does anybody have any experience with this?

     

    Thanks in advance!

  9. Hi,

     

    I'm trying to implement the slider in the following link: http://developer.yahoo.com/yui/examples/slider/slider_dual_with_highlight.html

     

    I know the code is all there, but is that all I need to make it work?  Or do I need to include files with it?  It says something at the very bottom of the page about loading necessary JS and CSS.

     

    Also, and this is the main problem I'm having.  Is it possible to have the slider work with different ranges and different increments?  For example, I want to make it be a range from 1.0 to 5.0 in increments of .5.  So i.0, 1.5, 2.0, 2.5 etc.  Is this possible?

     

    Thanks in advance for any help :)

     

  10. Hi,

     

    I currently have in my view:

    <?=$this->formSelect('data[var]', $this->data['var'], array('id'=>'var'), $this->var)?>
    

     

    How can I make this a multi select box like:

    <select name=mytextarea size=3 multiple>
    

     

    I couldn't find anything in the documentation.

     

    Thanks in advance.

     

     

  11. Thanks for the replies. 

     

    Yes, I'm sending via a cron job.

     

    The problem with a $loop_max variable is I have to send this to thousands of users so I don't know in advance what the max will be.

     

    Thanks again for the reply.

     

    How are you executing the script? Cron jobs?

     

    If the script is executed at exactly midnight, and ytou only want to send a specific amount of emails in that one execution. Thyen logic like this should suffice:

     

    Loop (while $loop_count is less than $loop_max)
    Get Next Row From Mysql (that "Sent" = false)
    Send Email
    On Successfull Send, Set Row Field "Sent" = true
    end Loop

  12. I have a script which sends out emails every night at 12am.

    The problem is that the first and second email are going out together, rather than the first one day and the second the next day.

     

    Loop
    if(id == 1)
    	send email
    	increment id by 1
    	update database
    endif
    if(id == 2)
    	send email
    	increment id by 1
    	update database
    endif
    End Loop	
    

     

    This is obviously going to send both the same night as the first if is incrementing the id so the 2nd if will be true.

     

    Is there a way around this?  I have a "date_modified" field in a MySQL database which is updated after each email is sent.  Could I use this somehow to help here?

    For instance:

    if (id == 1 & date_modified !> ... ? )
    

     

    Any help would be appreciated.

     

    Thanks in advance.

  13. Hi,

     

    I

    'm having trouble getting this to show up in IE.

     

    <html>
    <head>
    <script language="text/javascript" src="../../includes/audio-player/audio-player.js"></script>
    </head>
    
    <body>
    <object type="application/x-shockwave-flash" data="../../includes/audio-player/player.swf" id="audioplayer1" height="24" width="290">
    	<param name="movie" value="audio/audio-player/player.swf">
    	<param name="FlashVars" value="playerID=1&soundFile=http://www.xxx.com/media/100709.mp3">
    	<param name="quality" value="high">
    	<param name="menu" value="false">
    	<param name="wmode" value="transparent">
    </object>
    
    <br/>
    <p style="color:#555555"><i>Brian S. Interview</i></p>
      
    </body>
    </html>
    

     

    Can anybody see anything wrong that would make this happen?

    It runs fine in FF and Safari.

     

    Thanks.

  14. Hi,

     

    I have a button as follow:

     

    #memberlogin .login{
    background:url(/images/memberlogin_btn.gif) no-repeat left top;
    display:block;		
    width:130px;
    height:31px;
    border:0; 
    }
    

     

    I need to make a rollover.  This is one image, same as this method:

    http://www.nowcss.com/links/image-rollover-with-css

     

    I tried it this way

    #memberlogin a.login span { 
            display: none; 
    }
    
    #memberlogin a.login:hover { 
            background: url(/images/memberlogin_btn.gif) repeat 0px -31px; 
    }
    

    but it's not working, do you know what I'm doing wrong here?

     

    Thanks in advance.

×
×
  • 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.