1. Post #1241
    Richy19's Avatar
    May 2010
    5,368 Posts
    If I have this:

    $qry = $DBH->prepare("SELECT DATE_FORMAT(Day, '%D') AS day, DATE_FORMAT(Day, '%M') AS month, WorkedOut, Coded, Studied FROM Days WHERE month=:currMonth ORDER BY Day DESC");
            $qry->bindValue(':currMonth', "March", PDO::PARAM_STR);
    
            $qry->execute();
            if($qry->rowCount() == 0)
            {
                    $qryI = $DBH->prepare("INSERT INTO Days(Day) VALUES CURDATE()");
                    $qryI->execute();
            }

    How do I access the values of the first query? all I know is fetch colum which gets a simgle column and fetch colum row, which fetches the given column but then moves to the next row, which means I cant access anything else in that row
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  2. Post #1242
    Web developer
    pdkm931's Avatar
    May 2008
    2,697 Posts
    fetch for a single row or fetchAll for every row.
    Reply With Quote Edit / Delete Windows 7 Show Events

  3. Post #1243
    Richy19's Avatar
    May 2010
    5,368 Posts
    Anyone have any idea why when I have my data in a table I get a small gap even tho I have set padding and margin to 0?



    #Calendar{
    	width: 600px;
    	height: auto;
    	padding: 0 30px;
    	margin: auto;
    }
    #Calendar table{
    	width: 600px;
    	height: auto;
    	padding: 0;
    	margin: 0;
    }
    #Calendar table tr{
    	padding: 0;
    	margin: 0;
    }
    #Calendar table tr td{
    	width: 25%;
    	padding: 0;
    	margin: 0;
    	border: 1px solid #000;
    }
    

    <div id="Calendar">
            <table>
                    
    <?php
    
            $qry = $DBH->prepare("SELECT DATE_FORMAT(Day, '%D of %M, %Y') AS dayf, WorkedOut, Coded, Studied FROM Days ORDER BY Day DESC LIMIT 0,20");
    
                    $qry->execute();
    
                    $res = $qry->fetchAll();
    
                    for($i = 0; $i <$qry->rowCount(); $i++)
                    {
                    ?>
                    <tr>
                            <td><?php echo $res[$i]['dayf']; ?></td>
                            <td><?php if(isset($res[$i]['WorkedOut'])) echo "W "; ?></td>
                            <td><?php if(isset($res[$i]['Coded'])) echo "C "; ?></td>
                            <td><?php if(isset($res[$i]['Studied'])) echo "S "; ?></td> 
                    </tr>                
                    <?php                  
                    }
    
            $DBH = null;
    
    ?>              
            </table>
    </div>
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  4. Post #1244
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Tables have cell padding by default. Go google table css
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Informative Informative x 1 (list)

  5. Post #1245
    Gold Member
    loony383's Avatar
    June 2007
    735 Posts
    Can anyone see a syntax error with this? "SELECT * FROM admin_pages WHERE key='pmanage'", It's giving me a syntax error and I have no idea why on such a simple SQL statement.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  6. Post #1246
    Moderator Illuminati
    Hexxeh's Avatar
    June 2006
    5,091 Posts
    What's the error?
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  7. Post #1247
    Gold Member
    loony383's Avatar
    June 2007
    735 Posts
    "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key='pmanage'' at line 1" - One thing I did notice is it is adding in an extra ' at the end, but even if I go to run it manually without it(rather than in php) it still gives me a syntax error in HeidiSQL
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  8. Post #1248
    Dragon Member
    Dragory's Avatar
    January 2006
    1,312 Posts
    I think "KEY" (and thus also "key") is a reserved name for e.g. "FOREIGN KEY".
    I had the same problem when one of my fields was called "from".
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 1 (list)

  9. Post #1249
    Gold Member
    loony383's Avatar
    June 2007
    735 Posts
    I think "KEY" (and thus also "key") is a reserved name for e.g. "FOREIGN KEY".
    I had the same problem when one of my fields was called "from".
    That was it, thanks!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 1 (list)

  10. Post #1250

    April 2011
    211 Posts
    A friend is looking for good shared hosting - got any suggestions? I haven't used shared hosting in years so I barely know anything about the market. Her budget is 60-80 USD/year and got no specific demographic.
    Reply With Quote Edit / Delete Mac Sweden Show Events

  11. Post #1251
    Gold Member
    jetboy's Avatar
    January 2009
    2,256 Posts
    A friend is looking for good shared hosting - got any suggestions? I haven't used shared hosting in years so I barely know anything about the market. Her budget is 60-80 USD/year and got no specific demographic.
    www.lithiumhosting.com
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 4 (list)

  12. Post #1252
    Gold Member
    dastiii's Avatar
    March 2012
    37 Posts
    Anyone have any idea why when I have my data in a table I get a small gap even tho I have set padding and margin to 0?



    #Calendar{
    	width: 600px;
    	height: auto;
    	padding: 0 30px;
    	margin: auto;
    }
    #Calendar table{
    	width: 600px;
    	height: auto;
    	padding: 0;
    	margin: 0;
    }
    #Calendar table tr{
    	padding: 0;
    	margin: 0;
    }
    #Calendar table tr td{
    	width: 25%;
    	padding: 0;
    	margin: 0;
    	border: 1px solid #000;
    }
    

    <div id="Calendar">
            <table>
                    
    <?php
    
            $qry = $DBH->prepare("SELECT DATE_FORMAT(Day, '%D of %M, %Y') AS dayf, WorkedOut, Coded, Studied FROM Days ORDER BY Day DESC LIMIT 0,20");
    
                    $qry->execute();
    
                    $res = $qry->fetchAll();
    
                    for($i = 0; $i <$qry->rowCount(); $i++)
                    {
                    ?>
                    <tr>
                            <td><?php echo $res[$i]['dayf']; ?></td>
                            <td><?php if(isset($res[$i]['WorkedOut'])) echo "W "; ?></td>
                            <td><?php if(isset($res[$i]['Coded'])) echo "C "; ?></td>
                            <td><?php if(isset($res[$i]['Studied'])) echo "S "; ?></td> 
                    </tr>                
                    <?php                  
                    }
    
            $DBH = null;
    
    ?>              
            </table>
    </div>
    http://www.quackit.com/css/propertie...er-spacing.cfm
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  13. Post #1253
    Gold Member
    loony383's Avatar
    June 2007
    735 Posts
    Anyone know of some good articles outlining optimal ways of securing a login system that's up to date? My login works and has basic security, but looking for a way to really make it locked down and secure.

    A server version would be good as well, I'd quite like to ensure my server isn't exploitable.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  14. Post #1254
    Warvibe's Avatar
    December 2008
    36 Posts
    Anyone have any idea why when I have my data in a table I get a small gap even tho I have set padding and margin to 0?
    http://cssdog.com/css_border-collapse.html
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  15. Post #1255
    Gold Member
    StinkyJoe's Avatar
    June 2006
    2,194 Posts
    Anyone know of some good articles outlining optimal ways of securing a login system that's up to date? My login works and has basic security, but looking for a way to really make it locked down and secure.

    A server version would be good as well, I'd quite like to ensure my server isn't exploitable.
    The "server version" part of it is simple: keep your software up-to-date.

    For your login system, if you let me know what you have right now, I'll be able to tell you how you can improve it.
    Reply With Quote Edit / Delete Linux Portugal Show Events

  16. Post #1256
    Richy19's Avatar
    May 2010
    5,368 Posts
    The "server version" part of it is simple: keep your software up-to-date.

    For your login system, if you let me know what you have right now, I'll be able to tell you how you can improve it.
    Mind if I do the same? currently when you log in a hash is created from the server time and other data, this is then stored in the database with the users info as well as a cookie(and in session), then when the user uses the page I check that there are database entries with that hash and that userID(which is also stored in the cookie) and if so grant access
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events

  17. Post #1257
    Gold Member
    loony383's Avatar
    June 2007
    735 Posts
    The "server version" part of it is simple: keep your software up-to-date.

    For your login system, if you let me know what you have right now, I'll be able to tell you how you can improve it.
    Currently stores passwords in MD5 (terrible I know, swapping this out for sha1 tomorrow), and stored user and pass (hashed) in a cookie, the plan was to use sha1 and salt it somehow, and use sessions for persistent logins rather than checking cookies every time, not really sure how I should be storing user data once they are logged in.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  18. Post #1258
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Mind if I do the same? currently when you log in a hash is created from the server time and other data, this is then stored in the database with the users info as well as a cookie(and in session), then when the user uses the page I check that there are database entries with that hash and that userID(which is also stored in the cookie) and if so grant access
    Use something random, not an (relatively) easily guessible value like server time
    Reply With Quote Edit / Delete Australia Show Events Agree Agree x 1 (list)

  19. Post #1259
    M4RK's Avatar
    August 2011
    114 Posts
    Any idea how to fix this? I just want the pic to fit the screen.
    http://puu.sh/lnnZ

    Heres the code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <body background="../Pictures/abstractmovement.png" bgcolor="#333333">
    <a href="http://www.sourcehosters.com"><img src="../Pictures/sourcehosters.png" /></a>
    </body>
    </html>
    Reply With Quote Edit / Delete Windows 7 Anonymous Proxy Show Events

  20. Post #1260
    World of Vagax
    darth-veger's Avatar
    December 2008
    21,242 Posts
    I'm installing Kusaba X but everytime i want to install it by going to www.example.worldofvagax.com/install.php it downloads the .php file instead of executing it. Same as for when i go to the root as it will download "Download" with no extension

    This does not occur by any of my other sub domains
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  21. Post #1261
    Gold Member
    wizard`'s Avatar
    August 2009
    932 Posts
    Any idea how to fix this? I just want the pic to fit the screen.
    http://puu.sh/lnnZ

    Heres the code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <body background="../Pictures/abstractmovement.png" bgcolor="#333333">
    <a href="http://www.sourcehosters.com"><img src="../Pictures/sourcehosters.png" /></a>
    </body>
    </html>
    put your background image into the contentcontainer div with width set to 100%.

    CSS like this..

    Code:
    body .contentcontainer {
    	width:100%;
    	height:auto;
    	position:absolute;
    	left:0px;
    	top:0px;
    }
    HTML like this..

    Code:
    <html>
         <body>
              <div class="contentcontainer">
                   <img src="../Pictures/abstractmovement.png" width="100%" style="z-index:1;" />
              </div>
         </body>
    </html>
    It's a bit of a cron-job but she'll get the job done. Just make sure your primary content is in a div with a z-index larger than one.
    Reply With Quote Edit / Delete Windows XP Australia Show Events

  22. Post #1262
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    put your background image into the contentcontainer div with width set to 100%.

    CSS like this..

    Code:
    -snip
    HTML like this..

    Code:
    -snip-
    It's a bit of a cron-job but she'll get the job done. Just make sure your primary content is in a div with a z-index larger than one.
    more simple :)

    Code:
    img.bg {
    	z-index:-1;
    	width:100%;
    	position:absolute;
    	left:0px;
    	top:0px;
    }
    HTML

    Code:
    <html>
    <body>
    	<img class="bg" src="../Pictures/abstractmovement.png" />
    </body>
    </html>
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  23. Post #1263
    Hullu V3's Avatar
    October 2009
    6,412 Posts
    Anyone know a code to a similar effect that is on this site for the Facebook and language buttons? http://farang.fi/
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  24. Post #1264
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Anyone know a code to a similar effect that is on this site for the Facebook and language buttons? http://farang.fi/
    http://spoonfedproject.com/jquery/jq...-hover-effect/
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #1265
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  26. Post #1266
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,045 Posts
    Currently stores passwords in MD5 (terrible I know, swapping this out for sha1 tomorrow), and stored user and pass (hashed) in a cookie, the plan was to use sha1 and salt it somehow, and use sessions for persistent logins rather than checking cookies every time, not really sure how I should be storing user data once they are logged in.
    just have a session id on the client that corresponds to a session on the server (or just use $_SESSION if you're using php). The passwords in the database should be stored using something like bcrypt. (hi!)
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  27. Post #1267
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    How to force a vertical scrollbar? (And rather not 1px margin on html)
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  28. Post #1268
    Gold Member
    SataniX's Avatar
    May 2010
    5,635 Posts
    Anyone here experienced with MyBB? I'm trying to get MyBB variables to work within the "MyCode" feature to absolutely no avail.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #1269
    jung3o's Avatar
    October 2011
    2,059 Posts
    Anyone here experienced with MyBB? I'm trying to get MyBB variables to work within the "MyCode" feature to absolutely no avail.
    me
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #1270
    Unmetered VPS
    Fizzadar's Avatar
    June 2010
    1,247 Posts
    How to force a vertical scrollbar? (And rather not 1px margin on html)
    overflow-y: scroll; :)
    Reply With Quote Edit / Delete Mac Canada Show Events

  31. Post #1271
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    overflow-y: scroll; :)
    Thanks
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  32. Post #1272
    -Kesil-'s Avatar
    February 2012
    87 Posts
    New Job...

    So they have me using Expression Engine
    First of all, how does that make yall feel?
    Second of all, is there an E-commerce plugin for expression engine that doesn't reek? My co-worker said that they usually make their own. (looks like I'll be doing the same) Other options cost.

    (how am I seriously employed in web development?)
    Reply With Quote Edit / Delete Mac United States Show Events

  33. Post #1273
    jung3o's Avatar
    October 2011
    2,059 Posts
    (how am I seriously employed in web development?)
    If you really have to ask you that question, you should probably tell the person that you can't develop web.

    Edited:

    Second of all, is there an E-commerce plugin for expression engine that doesn't reek? My co-worker said that they usually make their own. (looks like I'll be doing the same) Other options cost.
    That is if you are willing to keep up the development and fix bugs all the time. Since it's yours you will have to answer all the question that comes from your client all the time.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #1274
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    New job...
    the old one didn't last long
    Reply With Quote Edit / Delete Australia Show Events Zing Zing x 1Friendly Friendly x 1 (list)

  35. Post #1275
    -Kesil-'s Avatar
    February 2012
    87 Posts
    the old one didn't last long
    New job = moved up

    Edited:

    If you really have to ask you that question, you should probably tell the person that you can't develop web.

    Edited:

    That is if you are willing to keep up the development and fix bugs all the time. Since it's yours you will have to answer all the question that comes from your client all the time.
    #1: welllllp :|

    #2: I think that will be good. I plan to use a lot of these packages for my own personal projects anyway. So long as I make it flexible we should be good to go. :)
    Reply With Quote Edit / Delete Linux United States Show Events

  36. Post #1276
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    What exactly should you know before looking for a job as webdev? I would really like to get a job but Im not sure if i have the required skills.

    I have no certificates or something like that. Im mostly selftaught, only had a couple classes at school (3th year ICT).
    Reply With Quote Edit / Delete Netherlands Show Events

  37. Post #1277
    jung3o's Avatar
    October 2011
    2,059 Posts
    What exactly should you know before looking for a job as webdev? I would really like to get a job but Im not sure if i have the required skills.

    I have no certificates or something like that. Im mostly selftaught, only had a couple classes at school (3th year ICT).
    Works that you are impressed about and think others will be impressed about too.
    PHP is not the type of language that people seem to be impressed about IMO
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 1 (list)

  38. Post #1278
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    Why does it matter in what languae you make something? If it gets the same thing done there is no diffrence for the end user.

    I know, html, css, php and js. What else should I learn before considering a job?
    Reply With Quote Edit / Delete Netherlands Show Events

  39. Post #1279
    Meow :3
    Ac!dL3ak's Avatar
    July 2005
    6,045 Posts
    Why does it matter in what language you make something? If it gets the same thing done there is no diffrence for the end user.
    if another developer wants to come along and extend what you've made, the readability of what you've written comes into play.
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  40. Post #1280
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    780 Posts
    if another developer wants to come along and extend what you've made, the readability of what you've written comes into play.
    But that has little to do with the language and more about the write style of the developer...
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events