Jump to content

miseleigh

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

About miseleigh

  • Birthday 03/29/1985

Contact Methods

  • AIM
    miseleigh
  • Website URL
    http://nasamanim.deviantart.com/

Profile Information

  • Gender
    Not Telling

miseleigh's Achievements

Member

Member (2/5)

0

Reputation

  1. Nevermind, we found a better way to do it anyway, but for future reference for anyone else - it's called ROW_COUNT(). Just call SELECT ROW_COUNT() after an insert, update, or select, and you'll have the number of affected rows.
  2. The MySQL manual says that the update statement returns the number of affected rows. We're trying to figure out how to use that feature, and it seems that few people use it or even think about using it. The way we've been doing it in the past has been performing the update and then doing a select to get the count. However, we're trying to reduce the size of our stored procedure (we need it faster!) and combining those into one statement would help. Any tips on this one? It's been hard to find anything online. Basically, in the stored procedure, we want something like SET v_count = UPDATE Users SET active=1 WHERE username=v_username); instead of UPDATE Users SET active=1 WHERE username=v_username; SELECT COUNT(username) INTO v_count FROM Users WHERE active=1 AND username=v_username;
  3. Could you add a print_r($_REQUEST) statement in add_answer.php and post the results? What you have should be working.
  4. We're porting over to MySQL from MSSQL, and while trying to create the tables in our new MySQL DB we're getting a syntax error that we can't find. CREATE TABLE `makem`.`Clients` ( `cl_ID` INTEGER UNSIGNED NOT NULL, `cl_username` VARCHAR NOT NULL, `cl_password` VARCHAR NOT NULL, `cl_challenge` TINYINT NOT NULL DEFAULT 0, `cl_answer` VARCHAR DEFAULT NULL, `cl_name` VARCHAR DEFAULT NULL, `cl_contact` VARCHAR DEFAULT NULL, `cl_phone` VARCHAR DEFAULT NULL, `cl_email` VARCHAR DEFAULT NULL ) CHARACTER SET utf8; It says there's a syntax error near 'NOT NULL'. If anyone can spot it, please let me know so I can fix it and make my table. Thanks!
  5. We solved it by using an intermediary page on the parent domain that does the javascripts after getting values from the child page. Just a warning to anyone else trying this: whether it's http or https, or whether the www is present or not, makes a difference to javascript- they must be alike before and after for js to recognize it as the same domain.
  6. Well, we've figured out it's a cross-domain problem... and that a work-around for that is plug an iframe into the child that's located on the parent's domain. But how do we use that work-around in order to fill a field on the parent page?
  7. We're trying to pass a link from a child window to the parent window after we upload a file. For some reason, the javascripts below don't even seem to be running, although all the values are filled in correctly after the php is done. The only thing we can think of is that the child loses its window.opener after processing its own form. Essentially, the parent calls the child, then the child processes a form to upload a file, and the child is then supposed to fill in a link to that document. <SCRIPT type="text/javascript"> window.opener.document.<?php echo $ret_field;?>.value = "<?php echo $link;?>"; window.close(); </SCRIPT> The child page uploads eveything properly, but then does not close and does not fill in the value on the parent. Thanks for any help.
  8. Mentioning that it's an SQL query would have made a big difference here. $q=sqlquery("select distinct email from user,user_group where user.user_id=user_group.user_id and (group_id=3 or group_id=5) and notify=1 and email<>''");
  9. Well, nevermind, I had another typo in the command that tells the Ether to send data back, so I never sent it the right command... *doh!*
  10. Whoops, I had a typo in there, but it really does all work up to the read() call: $sock = socket_create(AF_INET, SOCK_DGRAM, 0); One possibility I've thought of is that the Ether doesn't know where to send its data back to. Is there a way to listen to a specific ip address & port number, since I have no way of telling the Ether who's talking to it?
  11. It would be helpful if you could mark which line is line 20, but just giving it a quick glance, you mistyped 'password' in your sql select statement. Also, you really don't need all those quotes: $sql="SELECT email, password FROM sign WHERE email = $email AND password = $password"; would work.
  12. I'm using UDP sockets to talk to an Ether IO 24 board, and I need to make my commands get through properly, so I'm trying to read back the data I send to it. However, I'm not getting anything, and instead my browser just hangs. I don't know much about sockets (this is my first time using them) so maybe there's something I should be doing that I'm not or vice versa. Any help would be greatly appreciated. set_time_limit(0); $socket = socket_create(AF_INET, SOCK_DGRAM, 0); $result = socket_connect($sock, $IP, $Port); $cmd = pack("ci", $writeA, $xff); // writes to device - this works socket_write($sock, $cmd); $cmd = pack("c", $readA); // tells device to send data back socket_write($sock, $cmd); $buf=socket_read($sock, 2); // I get nothing here echo $buf;
  13. Thank you effigy, that is working perfectly.
  14. Thanks for your replies, but neither worked. I think the problem is that PHP is evaluating the \x part before the number is added to the string, so it doesn't realize it's supposed to escape it. Or something.
×
×
  • 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.