Jump to content

freenity

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Everything posted by freenity

  1. The right syntax should be: UPDATE `mem` SET `uM` = ( SELECT IF ((SELECT (`uM` - %d) FROM `mem` WHERE `uid` = %d) > 0), (SELECT (`uM` - %d) FROM `mem` WHERE `uid` = $d), 0 ) The problem with this is that it won't let you update the same table.... I guess it's because you are reading and writing it at the same time.
  2. UPDATE `mem` SET `cash` = ( SELECT IF ((`cash` - $num) > 0), (`cash` - $num), 0 ) I guess this should work, haven't tested
  3. just see the database and look for a table called users or something.... and see if it has some field called lastlogin or lastvisit......
  4. freenity

    NULL

    Wait...... What is this??? if (!$suff) { } else { $db .= "AND sufix = '$suff'"; } Should be: if ($stuff) //read if NOT null then do { $db .= "AND sufix = '$suff'"; } Thats all, the code you have check if $stuff is not null it does nothing. and then in else (NULL) it adds the suffix btw. you can make this check with sql: SELECT * FROM $tble WHERE model = $modnum AND sufix IS NOT NULL;
  5. hmm strange code you have. I would use this: Check out if it works <? include('functions.php'); $year=$_POST['year']; $month=$_POST['month']; $sql = "SELECT event_date FROM calendar_events WHERE status='confirmed'and event_type='gig'"; $result = mysql_query($sql); $x=mysql_num_rows($result); $postdata=''; if ($x>0) { for ($i=0;$i<$x;++$i) { $row=mysql_fetch_row($result); $fr_date = explode('.', $row[0]); $checkmonth=$fr_date[1]; $checkyear=$fr_date[0]; if ($year==$checkyear && $month==$checkmonth) if ($postdata=='') $postdata=$postdata.$data; else $postdata=$postdata.' '.$data; ;} ;} echo "resultstr=".$postdata; ?>
  6. You can do math but not like that. This would be correct: mysql_query("UPDATE `member` SET `cash` = `cash` + 1 WHERE `id` = NUM "); also: SELECT * FROM member WHERE ((fieldA + fieldB) - fieldC) > fieldD) ... just an example....
  7. kpetsche20 The problem is in your code. You don't put necessary headers. Some services like hotmail won't accept your email, they won't even put it in the spam folder. Check this out: http://gwphp.feudal-times.net/?p=4 it's a code extracted from phpbb3, works fine (tested)
  8. you can't make a list field but you can make a varchar field and separate those ids with spaces, of course you won't be able to access to those ids using sql but with a little help of php. Check these functions yo'll need them: implode() explode()
  9. Wait what do you really want to do?? $var = "<?php echo $title; ?>" // here you put "<?php echo $title; ?>" to $var. You put the string, you dont print $title. You just put this string as it is..... $table = "$var" // here again you put "$var" string to $table. NOT its value. Not sure what you want to do with this.
  10. You can also connect directly to the database and select the users from there. Im not sure how the stuff are made in vBulleting but there must be some field like lastlogin or something in the user table. So you just make a $t = time() - 600; // select users who visited forum on last 10 minutes. SELECT * FROM user WHERE lastlogin < $t Thats it. Remember you can't have real time statistics with php, only show some stats over last x minutes....
  11. The images from the main page are suppose to be grainy XD I just added some noise to it =) But the alias thing is because of the image size, alway want to reduce it more XD Thanks for the comment.
  12. Might sound weird but I could only understand the whole programming principles after learning some asm XD Really It just doesn't tell you what variables types you have, you just have 1byte 2 bytes, 4bytes ,etc and that rocks XD No arrays, no echo functions, no ifs, no while, no fors !!!!! =) I started with dos asm, and then with win32 btw win32 asm is about using windows api, so it doesn't look so different from other high lvl lang as C.... And with modern assemblers (FASM for ex.) you can use some high lvl structures like IF, WHILE, SWITCH, etc
  13. Anyone using Kate here? That's what I have in my fedora box with KDE =)
  14. to make a unique referral code is quite easy use this function as example: function generate_code($length) { $data[] = array(1,2,3,4,5,6,7,8,9,0,'a','b','c','d',e','f'); $res = ''; for ($i=0;$i<$length;$i++) { $res .= $data[rand(0,count($data))]; } return $res; } This code will only return a randomly generated code as a string, but only symbols from 0 to 9 and a,b,c,d,e and f example result: 'a63f9c'.... You can change it adding more letters or symbols like */,. etc The length parameter is for setting how many symbols you want to include in 1 code for example you have 2 tables: tableA tableB each table has a field name `code` You can do this: SELECT tableA.id, tableA.code, tableA.username, tableA.idontknowwhatelse FROM tableA, tableB WHERE tableA.code = tableB.code; So basically all you do is put : table . field and that how you can refer to other tables in the same query.
  15. Feudal Times - http://feudal-times.net It's a browser based game I made. The main page is a valid xhtml strict tableless design (+ajax) The ingame interface is a bit older that's why it has normal tables, but with some ajax, css. and nice looking buttons.... Well I shouldn't make a review of my website, please you make it XD Comment, thanks for any feedback. p.s. the game is in php5 oop + mysql
  16. got it just changed popup to be inside the btn1 div, it worked BUT only in FF. IE doesnt detecting it. Any idea/??
  17. agentsteal Do you use any program to test sites???
  18. Looks nice BUT on FAQ tab, not sure what is there but seems like you have a xss injection... that 37707 alert() =)
  19. it can't be done, because you can't messure time with css...
  20. This is the complete code: <script> var isIE = document.all; var mouseX = 0; var mouseY = 0; function getMouseXY(e) { if (!e) e = window.event; if (e) { mouseX = isIE ? (e.clientX + document.body.scrollLeft) : e.pageX; mouseY = isIE ? (e.clientY + document.body.scrollTop) : e.pageY; } } document.onmousemove = getMouseXY; function showpopup(e) { if (e.pageX || e.pageY) { document.getElementById('popup').style.top = mouseY+20; document.getElementById('popup').style.left = mouseX+20; } } </script> <style> #btn1 { width: 300px; height: 50px; position: absolute; top: 100px; left: 50px; background: #eeeeee; z-index: 22; } #popup { width: 200px; height: 200px; z-index: 999; background: #ee8888; border: 1px solid #222222; position: absolute; top: 1px; left: 1px; visibility: visible; } #btn1:hover #popup { background: #ff0000; } </style> <div id="btn1" onmousemove="showpopup(event)"></div> <div id="popup"></div>
  21. Hi css guru Here is my question: #btn1:hover #popup { background: #ff0000; } Why this doesn't work??? This should change the background color of div id=popup when the mouse is over the div id=btn1
  22. The ajax seems to work fine but error code is still there... Anyone knows why is happening this?
  23. SOLVED Just had to change ob.open("GET", url, true); ob.send(null); ob.onreadystatechange = function() { /*line 65 error here */ if ((ob.status == 200) && (ob.readyState == 4)) { document.getElementById(obname).innerHTML = ob.responseText; } } to ob.onreadystatechange = function() { if ((ob.status == 200) && (ob.readyState == 4)) { document.getElementById(obname).innerHTML = ob.responseText; } } ob.open("get", url, true); ob.send(null); weird :S
  24. Hi Actually it's a very strange problem it works fine in firefox but not in IE. I tried IE 6 and 7. The problem is that I have a link to an ajax requested page. When I click on this link for the first time it works but if I click again, it doesnt. It doesnt even enters the ob.onreadystatechange = function() Here is the code: function getdata(url, obname, loading) { var ob; if (window.XMLHttpRequest) { ob = new XMLHttpRequest(); } else { if (window.ActiveXObject) ob = new ActiveXObject("Microsoft.XMLHTTP"); } if (loading) document.getElementById(obname).innerHTML = "<center>Loading...</center>"; ob.open("GET", url, true); ob.send(null); ob.onreadystatechange = function() { /*line 65 error here */ if ((ob.status == 200) && (ob.readyState == 4)) { document.getElementById(obname).innerHTML = ob.responseText; } } } IE show an error on line 65 char 3. system error: -22147467259 Thanks for any help
×
×
  • 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.