Jump to content

dlebowski

Members
  • Posts

    262
  • Joined

  • Last visited

Everything posted by dlebowski

  1. I think I will do just that. Thanks.
  2. This query is taking about 4 seconds to run. Can anyone help make it more efficient? I have only a couple hundred rows in each table so it shouldn't take long at all. DELETE from sellertotals where SellerTotalNumber not in (select SellerNumber from lots WHERE LotAuctionDate = '$LotAuctionDate') AND SellerTotalDate = '$LotAuctionDate This query removes any entry that has been made in the sellertotals table that doesn't match what is in the lots table for that same date. Any help would be appreciated. Thanks.
  3. Thanks for taking the time to make me feel a little better about my decision. I will keep plugging away at it.
  4. So there really isn't a limit then? I have an application that will have 1000 entries in the database per week. No attachments. Just entries consisting of about 10 columns or so worth of data. I keep seeing this "4 GB limit" everywhere on the net. Apparently that is no longer the case. My next question is in regards to simultaneous queries. I currently utilize a hosted solution for my application and understand that I will not be able to have 200 people all submitting queries at the same time without creating cpu utilization problems. That being said, have you ran into problems with too many people hitting a database simultaneously while using MYSQL?
  5. Does anyone know if there are DB size limitations within MYSQL? I have gotten conflicting reports everywhere I have looked on the internet. Can someone let me know if/what the limitations of MYSQL are in regards to size? I have a database that is already getting very large after three months and I am concerned that maybe I should look into a different DB alternative. Let me know if anyone can help me out. Thanks in advance.
  6. Got it to work by doing this: <?php mysql_connect('localhost'); mysql_select_db('test'); $res = mysql_query('select customer_id FROM customer ORDER BY customer_id' ); $j = mysql_num_rows($res); $i = 0; while ($i++ < $j and mysql_result($res, $i - 1, 0) == $i); echo 'Next available number is: ', $i; ?>
  7. Sasa, I just modifed my code to prevent the entry of "0" as an ID. This is going to work fine. Thank you very much! Spent many hours on this one. -Ryan
  8. "Warning: mysql_result() [function.mysql-result]: Unable to jump to row -1 on MySQL result index 3 in /test.php on line 11" is the error I get. I may just not be able to have an ID of zero in there. If that is the case, I can deal with that.
  9. THe problem is that in the ID field was the value "0". It didn't like that. Once I deleted it, it appears to work! I will try and figure out what I need to add to that code you provided to work with a field of 0 in it. Thanks again!!!
  10. Sasa, This actually works on my primary key field, but not the ID?? Not sure why that would be, but it does seem to work on the primary key field.
  11. This query is just giving me the first ID in my list. In this case it's 1. Let me do some more testing. Thanks for giving it a shot.
  12. I completely agree, but if it's possible it would be better for my client. They are an auction company and some customers like having 1 digit numbers and other want four digits numbers. The first person that wants an ID in the 9000's, will result in the next available number as 10,000 before too long. But, I understand that there may be not other choice.
  13. Thanks for the link. This will work with one exception. If I have 1, 2, 3, 4, 5, 7, 8, 9, 10 all used as customer numbers. The number 6 is an available number, but with "SELECT max" I will get the number 11. Is there any kind of query that may recognize that 6 is available? If not, I will go with the "SELECT max" suggestion provided to me as it will do the trick. Ryan
  14. I have a php/mysql page site that I am putting together and what I need is a mysql query that will query the database, select a specific table, a specific column, and output the next available number in sequence that has not been assigned yet. For example, this database is a customer database with each customer having their own ID. Every time I add a new customer, I have to know what ID is available. I would like the DB query to tell me what the next available number is. Any help on this would be great. Thanks in advance. -Ryan
  15. In this particular case, I need to define a number for them. I have another field I created within my table that auto increments that is the primary key. This field is one I can just manually put a number into.
  16. This may actually be a question for the MYSQL forum, but I will give it a shot here first. I have a php/mysql page site that I am putting together and what I need is a mysql query that will query the database, select a specific table, a specific column, and output the next available number in sequence that has not been assigned yet. For example, this database is a customer database with each customer having their own ID. Every time I add a new customer, I have to know what ID is available. I would like the DB query to tell me what the next available number is. Any help on this would be great. Thanks in advance. -Ryan
  17. Hello. Below is my code for the .js portion of my ajax code that I have written. Is there anyway to use pagination within this code? Thanks for helping me out. var xmlHttp function updatelotslive(str, str2, str3, str4, str5, str6, str7, str8, str9, str10) { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="updatelotslive.php" url=url+"?ud_LotID="+str url=url+"&ud_LotNumber="+str2 url=url+"&ud_LotTitle="+str3 url=url+"&ud_SellingPrice="+str4 url=url+"&ud_LotPaymentExempt="+str5 url=url+"&ud_Buyer="+str6 url=url+"&ud_OnlineOnsite="+str7 url=url+"&ud_AbsenteeBid="+str8 url=url+"&ud_SellerNumber="+str9 url=url+"&ud_LotAuctionDate="+str10 url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtHint").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
  18. Thank man. Exactly what I needed. I took it one step further to resolve my problem: DELETE * from table1 where id not in (select id from table2 WHERE Date = '$date) AND Date = '$date'
  19. You are going to first have to create your database and your user name and password with your hosting provider. Your hosting provider may be able to help you with that. Your end result will look something like this: <?php /** * file: db_config.php * * description: init db connection */ $db_name = "membermanagement"; // database name $db_user_name = "ryan3456"; // database user name $db_user_password = "7?@rtY"; // datanase user password $db_type = "mysql"; // note: for use mysqli lib set db_type = mysqli $host = "localhost"; ?>
  20. For some reason, I am struggling with the query, maybe someone can help me out. Here is what I'm trying to do: Before Query: Table 1 Table 2 ID | DATE ID | DATE ------------- ----------- 1 2007-01-01 1 2007-01-01 2 2007-01-01 1 2007-01-01 3 2007-01-01 2 2007-01-01 4 2007-12-12 3 2007-01-01 5 2007-01-01 3 2007-01-01 4 2007-12-12 After Query: Table 1 Table 2 ID | DATE ID | DATE ------------- ----------- 1 2007-01-01 1 2007-01-01 2 2007-01-01 1 2007-01-01 3 2007-01-01 2 2007-01-01 4 2007-12-12 3 2007-01-01 3 2007-01-01 4 2007-12-12 I need the query to take the values in Table 1 and in Table 2 and compare them. If Table 1 has an ID that doesn't exist anywhere Table 2 with the same date, then Table 1 needs to have that row removed. Any help would be greatly appreciated. Please let me know if I need to elaborate. Ryan
  21. I finally got this one figured out after some helpful suggestions. Here is what it needs to look like to work: <TD width=98 height="29" align="center"> <select name="ud_OnlineOnsite" align=center> <option value="ONLINE" <? if ($OnlineOnsite == "ONLINE") echo "selected"; ?> >ONLINE</option> <option value="ONSITE" <? if ($OnlineOnsite == "ONSITE") echo "selected"; ?> >ONSITE</option> </select> </td>
  22. Thorpe, Here is what I have. What is odd is that it now will let me change a value in IE 7 from Onsite to Online, but it will not let me change it from Online to Onsite. Any ideas on why that would be? I'm closer than I was. Thanks for helping. <TD width=98 height="29" align="center"> <? echo '<select name="ud_OnlineOnsite">'; echo '<option'.($OnlineOnsite=="ONLINE"? ' selected="selected"' : '').'>ONLINE</option>'; echo '<option'.($OnlineOnsite=="ONSITE"? ' selected="selected"' : '').'>ONSITE</option>'; echo '</select>'; ?> </td> <td><input value ="UPDATE" type="Button" onclick="updatelotslive(ud_OnlineOnsite.value)"></td>
  23. This is the result of a DB query. $OnlineOnsite is populated from a field in my table. <? include("dbinfo.inc.php"); mysql_connect("localhost",$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // get value of id that sent from form submission $LotAuctionDate=$_GET['ud_LotAuctionDate']; $query=" SELECT * FROM lots WHERE LotAuctionDate='$LotAuctionDate' ORDER BY LotNumber"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table> <TD width="69" class="maroonbar"> <center>Type</center> </TD> </table> <? $i=0; while ($i < $num) { $OnlineOnsite=mysql_result($result,$i,"OnlineOnsite"); ?>
  24. I forgot to tell you "what doesn't work". When I select a value to submit to update the database in IE7, the value doesn't not get updated. It does however update when I use firefox.
×
×
  • 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.