User Profile

Collapse

Profile Sidebar

Collapse
xwero
xwero
Last Activity: Jan 11 '08, 11:23 AM
Joined: Feb 8 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • xwero
    replied to weird insert problem
    I solved the problem. It was the previous field which broke the insert statement.
    See more | Go to post

    Leave a comment:


  • xwero
    started a topic weird insert problem

    weird insert problem

    I have a query like this
    Code:
    INSERT INTO table (name,count) VALUES ('test',2)
    The count field is of the int(10) type. I get no error but the row isn't displayed in the table but the auto increment is raised. With the values 0 and 1 the sql statement works. If i use a phpMyAdmin sql it works with higher values but not when i do it in my php script.

    I made the table copying it from an older table where the count field...
    See more | Go to post
    Last edited by xwero; Jun 28 '07, 09:59 AM. Reason: added information

  • xwero
    replied to Shopping Cart
    in PHP
    I understand now but then you need to have only one form for that to work

    [PHP]
    <?php
    if(isset($_POST['send'])){
    foreach($_POST['send'] as $buttonvalue){
    if(is_numeric($ _POST['quantity_'.$bu ttonvalue]) && $_POST['quantity_'.$bu ttonvalue] > 0){
    echo $_POST['quantity_'.$bu ttonvalue].' x '.$buttonvalue. '<br>';
    // database code and count...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to favicon in ie6
    what is your favicon code? i believe you have to use rel="SHORTCUT ICON" with capital letters...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to IFRAME trouble
    for inline links you only need #linkname. if you want to link from outside the page you have to do it in javascript because you have to specify the dom. It's been so long ago i used frames if forgot the code for frames :)

    It's not good practice to put your content in an iframe because bots don't register it then. Use a server side language to stitch the page parts together this will be better for your site and if you want to limit...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to cryptic html validator
    have you tried it with another doctype?...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to image display error
    in PHP
    I think the ?gim part doesn't get processed by php. You just get the src attribute.

    In the first example you get no value because php sees gim='home1' as a new attribute. In html it's not wrong to add attributes that aren't part of the specifications. It's not a technique that is to be encouraged but browsers just look over those attributes....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Shopping Cart
    in PHP
    You have two inputs called pid, i think that is the problem. The easy way to do a tablebased item submit is using the button tag

    [HTML]<button type="submit" name="pid" value="'.$row['p_id'].'">ADD</button>[/HTML]

    This way you don't have to use hidden fields and you can put the table in one form instead of as many forms as there are items....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Perl to PHP conversion
    in PHP
    as far as i can tell in php it would be something like this
    [PHP]
    function texttool($tool) {
    $tool = strtolower($too l);
    $toolarr = split(' ',$tool);
    $toolarr2 = array()
    foreach($toolar r as $word){
    $tit1 = $word;
    $tit2 = $word;
    $tit2 = substr(strrev($ tit2),0,strlen( $tit2)-1);
    $tit1 = substr(strtoupp er($tit1),0,1);
    $toolarr2[] = $tit1.$tit2
    }
    return...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Date Formatting mysql->php
    in PHP
    Then i think there is no other solution then to format your date in php....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Date Formatting mysql->php
    in PHP
    Try it without the mysql function. Sometimes they don't work play nice with the mysql_query function.

    If that is the problem you have to reformat the DOB field in php....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Date Formatting mysql->php
    in PHP
    you have to replace DOB by date because the query returns the alias and not the fieldname, you could add the fieldname to the selected columns but i think that is not what you are looking for....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to how to generate a title automatically
    in PHP
    In the titlefield of the page?...
    See more | Go to post

    Leave a comment:


  • xwero
    replied to Date Formatting mysql->php
    in PHP
    have you tried

    Code:
    $sql="SELECT playerid, firstname, lastname, DATE_FORMAT(DOB, '%d-%m-%Y') as date FROM player order by surname";
    and get the alias (date) instead of the DOB field
    See more | Go to post

    Leave a comment:


  • xwero
    replied to how to generate a title automatically
    in PHP
    i think you nean something like this

    [PHP]
    <form action="<?php echo $PHP_SELF; ?>" >
    <select name="test">
    <option value="1">test 1</option>
    <option value="2">test 2</option>
    <option value="3">test 3</option>
    <option value="4">test 4</option>
    </select><br>...
    See more | Go to post

    Leave a comment:


  • to print an array to the screen you have to use print_r instead of echo.

    Your code looks fine....
    See more | Go to post

    Leave a comment:


  • I think if you want to pass a variable over multiple forms you put it in a session variable. This way it doesn't have to be in your form. Set the variable when you retrieve it and unset it when the last form is submitted correct....
    See more | Go to post

    Leave a comment:


  • xwero
    replied to how to bind Datagrid?
    in .NET
    As i understand from your explaination you want to add the username to all of your rows. This can be done with the OnItemDataBound . I assume you add a new column to your datagrid and you use a literal with the id: username. The OnItemDataBound attribute is a part of the asp:Datagrid tag and the value is a function, lets say dataBound.

    Code:
    <%@ Page Language="C#"  %>
    
    <script runat="server">
    ...
    See more | Go to post

    Leave a comment:


  • [PHP]

    if(isset($_REQU EST['Submit']))
    {
    $text = $_POST['name'];
    // for the first letter
    $string = preg_replace('/^([a-z]{1})/', strtoupper('$1' ),$text);
    // for all following words
    $string = preg_replace('/ ([a-z]{1})/', strtoupper('$1' ),$text);
    echo $string;
    }
    [/PHP]

    Which output do you get now?
    See more | Go to post

    Leave a comment:


  • [PHP]
    $text = preg_replace('/ ([a-z]{1})/', strtoupper('$1' ),$text);
    [/PHP]
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...