Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. [code]if($Rank >= 1)[/code]
  2. That will not work, redarrow.
  3. SELECT COUNT(colname) AS cntCol FROM tablexyz WHERE cat = 'x';
  4. That's because mysql_query is going to return the result set number. You really need to stop nesting your functions so you can troubleshoot more easily: [code]$query = "INSERT INTO `$compl` ( `Name` , `Sail Number` , `Class` , `Score` ) VALUES ( '$name', '$snum', '$boattype', '$score')"; $result = mysql_query($query) or die(mysql_error()); if($result && mysql_num_rows($result) > 0) {    $row = mysql_fetch_array($result); } [/code] That's how it should be structured. Then you can echo the query quite easily.
  5. I'm not sure, to be completely honest. I've never used sockets.
  6. If the values are truly numbers, change the datatype to int instead of varchar.
  7. Post the code again with the changes and double check to make sure your tablenames and column names match what you actually have.
  8. It's probably because: "SELCT * FROM `$compl` WHERE `Name`=$name" 1) you spelled "SELECT" wrong. 2) $name should be in quotes: "SELECT * FROM `$compl` WHERE `Name`= '$name'"
  9. To use your current method, you would have to call $row = mysql_fetch_array($result) between every < td >. To do it correctly, you need to have a column count, and your containing row would be closed when your column count == 3. That way, you call your main chunk of code that holds the item only once within the loop. I don't know if that makes sense, but it's hard for me to tell what it's currently doing.
  10. You cannot do that all in one query. INSERT INTO table1 (col1, col2) VALUES (val1, val2) run query $new_id = mysql_insert_id($result); INSERT INTO table2 (col1, col2) VALUES ($new_id, val2) run query
  11. If your host allows you to setup multiple FTP accounts, I don't see how having your "secondary" FTP account info on his server would be a problem. You could setup a subdomain on your hosting or a seperate area where the secondary FTP can only access that area. I wouldn't keep his info on your site, but I'd have no problem keeping "update ftp info" on his site.
  12. It's called "looking up the date() function in the manual".
  13. There are a few options to consider... FTP, Sockets... Both would probably do what you want.
  14. ober

    Link help

    [code]$sql2="SELECT * FROM clan_members WHERE Gamer_Tag='" . $_REQUEST['Gamer_Tag'] . "'"; [/code] I should also add that $_REQUEST is the global array that holds the $_GET and $_POST data... $_GET would hold the data you're passing, $_POST would hold data posted from a form that uses the POST method.... just to give you a little background info. ;-)
  15. I'm not exactly sure what you're asking, as your english isn't that great, but if you want to get a formatted string from the database, you have to use the date() function with a time/date format: [code]$login_time = date("n/j/Y h:i:s A", strtotime($row["login_time"])); [/code]
  16. Look, if your users like it, you're ok with it, and there are no functional problems, why listen to a bunch of web designers who may not have a clue about what makes a website look good? It's all about your opinion. You can agree or disagree with us. You're never going to make everyone happy. I'll email you a screenshot.
  17. I have to agree. It's pretty bad. It's extremely dark, your contrast between your text color and the background isn't strong enough, you have no hover effects on the nav or elsewhere, and your "reds" don't even match across the site, unless my eyes are playing tricks on me. I do like the logo, but the rest of the site needs a serious overhaul.
  18. Your || should be an &&. Well let's just go full out and list both ;-) [code] $comment_lines = 0; $code_lines = 0; foreach (glob("*.php") as $filename) {     $thefile = file($filename);     foreach($thefile as $key => $val){         if(trim($val) != '' && substr(trim($val),0,2) != "//" && substr(trim($val),0,2) != "/*")             $code_lines++;         if(trim($val) != '' && (substr(trim($val),0,2) == "//" || substr(trim($val),0,2) == "/*"))             $comment_lines++;     } } echo "Lines of code: $code_lines<br/>"; echo "Lines of comments: $comment_lines<br/>"; [/code] And we could get more tricky with it... look for lines that have series of "========", "---------", etc... and you could single out full comment blocks as well, looking for the beginning and ending /* */ Crazy.
  19. ober

    html chars

    Use a semicolon after or it or the value instead of the name: & # 1 8 0 ; (without the spaces)
  20. Glad to help :) I know some people are forced to do it, but I know there are a lot of people that don't know you can skip them.
  21. Yeah, like if you needed to reuse the recordset for another control or something. I think that's just there so that if something was set in another part of the code, that it will be the first selection... although I don't see any "selected" attribute in the option. I'm assuming at this point without seeing more of the code.
  22. Well, if you need to reset the recordset (not sure why you would want to), yeah.
  23. The first part is like using mysql_field_seek() ... the second part is like creating running $result = mysql_query() again.
  24. While that may be true, I think it's more than something you're going to just whip up with PHP and the GD library, but I've been wrong before.
  25. Yes, ASP is very inefficient. Wend is "While End"... it's like closing a bracket on a while loop in PHP.... and yes, you must include it for one liners. The if statement basically says "if the cursor (which is nothing more than a pointer in the recordset array) can use the MoveFirst call, do it.... otherwise run the query again to reset it at record 0". Hope that helps.
×
×
  • 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.