User Profile

Collapse

Profile Sidebar

Collapse
RayDube
RayDube
Last Activity: Jul 24 '09, 06:10 PM
Joined: Dec 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • RayDube
    replied to strlen issues - no mb_strlen available
    in PHP
    Thanks for the thoughtful replies.

    Yes, trim, ltrim and rtrim were all tried without success.

    utf8_decode was also tried, again, without success...

    And, as a matter of fact, after rebooting the machine with mb_ functions, I still got the same result (so not a multibyte thing)

    It's still got me puzzled, but in the meanwhile,I've switched to using dashes "-" instead of underscores...
    See more | Go to post

    Leave a comment:


  • RayDube
    started a topic strlen issues - no mb_strlen available
    in PHP

    strlen issues - no mb_strlen available

    I'm not sure if this is an encoding issue or not, but for some reason strlen is not giving me the correct length of a string stored in a mysql database.

    I have two strings, one containing letters and spaces, and another containing letters, spaces and underscores.

    Even if both strings are exactly the same length, the reported length given by strlen is incorrect.

    For testing I used these two strings:
    ...
    See more | Go to post
    Last edited by Atli; Jun 8 '09, 08:56 PM. Reason: Added [code] tags... HTML and spaces don't mix well.

  • Well, honestly?

    I re-wrote the script, entirely, forgot the include they had for sql setup, and the variables were passing, when I added the include, it stopped...

    Unfortunately, had I done that in the first place, I would have spotted it directly.

    Ray
    See more | Go to post

    Leave a comment:


  • Hi there,

    I've managed to find the problem, one of the included files is stripping the contents of the array, even though it's not supposed to do so.

    We're working with the original script creator to remove the problem code, unf, it's encoded... :(

    Ray
    See more | Go to post

    Leave a comment:


  • Hi there,

    Not many places to put those codes, but I did try to streamline it a bit and still can't imagine where the Array could possibly be emptying...

    This is the result after the first post (where the number of members to be awarded is determined):
    1 member:
    Code:
    Array ( [mems] => 1 [save] => Submit )
    5 members:
    Code:
    Array ( [mems] => 5 [save] => Submit )
    After...
    See more | Go to post

    Leave a comment:


  • Hi code green,

    I agree, no need to echo each line, but it was done because of "compressin g" there is a little bit of extra functionality in between that was edited out.

    Meanwhile, this *should* work, but doesn't, which is why I need an assist.

    Ray
    See more | Go to post

    Leave a comment:


  • Code:
    if($_POST["save"] == "Submit")
    {
      $mems = $_POST[mems];
      $i=0;
      while($i < $mems)
      {
        //build table with the number of cells equal to the number of members to update.
        echo "<tr>";
        echo "<td><input type=\"text\" id=\"memid[]\" name=\"memid[]\" value=\"\" size=8></td>";
    ...
    See more | Go to post

    Leave a comment:


  • updateing multiple rows at once, with different values..

    Hello Gents,

    I want to be able to reward my members with credits, banner advertisements, text advertisements and even cash, but on a partially manual basis.

    I created a page where I could decide how many members would get a reward, and then update them based on the member id and details I enter, here's the code for the page:
    Code:
    <?php
    /**
     * @author Raymond Dube
     * @copyright 2008
    ...
    See more | Go to post

  • RayDube
    replied to Fetch xth item from mysql_array
    in PHP
    Duh!

    Sorry people, the answer was so obvious it slapped us in the face!

    Code:
    SELECT column FROM table ORDER BY RAND() LIMIT 1
    Works like a charm!

    Ray

    (figures we should have just spoken to the sql guru rather than the php guru)
    See more | Go to post

    Leave a comment:


  • RayDube
    started a topic Fetch xth item from mysql_array
    in PHP

    Fetch xth item from mysql_array

    Hey gentlebeings,

    I'm pretty sure this is possible, just can't find the correct way to do it.

    I want to select the contents of my table of testimonials, and randomly display one of them on the screen.

    So the thinking we had over here was to count the number of rows and then select the xth row for display. We just weren't sure on the options available to us. :)

    One option was to count the...
    See more | Go to post

  • RayDube
    replied to How to access Global Array of an Array...
    in PHP
    Thanks for the tip, but I do believe that's what I started out with when I first moved to globals off... and it didn't work then, but that's probably because I tried to inject in the sql query directly, obviously a mistake. :)

    No matter, I assigned the debug variable $team1 to the Post value, and used the variable instead of the post variable.

    And I have to say this is probably something I should have done weeks ago,...
    See more | Go to post

    Leave a comment:


  • RayDube
    replied to How to access Global Array of an Array...
    in PHP
    Thanks for the advice,

    I only wish that were the problem. But it seems to me that the data is not being pulled from the onscreen table, that is, not from the database.

    Even when I declare some new variables for the onscreen table:
    Code:
      $team1points[] = "";
      $team2points[] = "";
    
    <snip>
    
    $site .="    <td style='width:20; text-align: left;'><input
    ...
    See more | Go to post

    Leave a comment:


  • RayDube
    replied to How to access Global Array of an Array...
    in PHP
    Here's the gist of it all.

    The page displays the teams that have played a game for a given week and has places to enter the score for that weeks games.

    There are 18 teams, so nine rows, two teams per row and text boxes for each teams score.

    After entering the scores, the manager will click on submit, the scores will be read from each line and updated in the database. The user is then re-directed to the...
    See more | Go to post

    Leave a comment:


  • RayDube
    replied to How to access Global Array of an Array...
    in PHP
    Thanks for the welcome, it's much appreciated...

    Maybe I should have posted a little more code. This does allow me to complete part of my work, but I'm also trying to update a database based on table info retrieved from the db...

    So

    [CODE=php]while ($schedule = mysql_fetch_arr ay($result))
    {
    $Match_ID[] = $schedule['Match_ID'];
    $Team1_Points[] = $schedule['Team1_Points'];
    $Team2_Points[]...
    See more | Go to post
    Last edited by pbmods; Jan 5 '08, 04:51 PM. Reason: Changed [CODE] to [CODE=php].

    Leave a comment:


  • RayDube
    started a topic How to access Global Array of an Array...
    in PHP

    How to access Global Array of an Array...

    Here's what I've got:

    [PHP] while ($schedule = mysql_fetch_arr ay($result))
    {
    $Match_ID[] = $schedule['Match_ID'];
    $Team1_Points[] = $schedule['Team1_Points'];
    $Team2_Points[] = $schedule['Team2_Points'];
    }
    [/PHP]

    And
    [PHP]for($i=0;$i<$co unt;$i++)
    {
    $team1 = $GLOBALS['Team1_Points[$i]'];
    $team2 = $GLOBALS['Team2_Points[$i]'];...
    See more | Go to post
No activity results to display
Show More
Working...