Jump to content

confused and dazed

Members
  • Posts

    313
  • Joined

  • Last visited

Everything posted by confused and dazed

  1. dsonesuk - could it be the way I have mysql database set up? Honestly I don’t want to waste anymore of anyone’s time on this one. I thought that by understanding why it is doing this I could learn from it and use that knowledge later. I guess I will have to leave it alone. The reason why I open and close connections like this because at one point I needed to do this for a site I was working on and I guess I just kept doing it. I will re-evaluate my use of opening a $con and closing it the way I do. Thanks.
  2. justsomeguy - what I ended up doing is creating a column in my table called IP_ad and made it a UNIQUE index. Then I updated my code to run a query on IP_ad to SELECT DISTINCT and count the rows. Then I sent that number to the database using INSERT INTO a column called count_IP. Finally I pull that number using window.onload and wala... my very own site counter!!! Thanks for the advice!!!
  3. It will always insert a new row of data... that is until I couple it with other code then it does not work anymore.
  4. It is exactly the same expect for the "xxx" is personal login information.And it is the ONLY code that is in that particular .php file listed in my hosting account.
  5. I guess I will never get to the bottom of it...hansolo - I get what you are saying and what everyone else is saying. The problem is that no matter how many ways anyone tries to explain $sql="INSERT... is not running a query and therefore cannot send any information to mysql it’s still not accurate. It IS sending information to my database every time. The issue is that if I couple that code with other code at that point it will NOT work and NOT send data to my database.
  6. justsomeguy - birbal - thanks for taking the time to respond to my posts. What I dont understand is why Code "A" will insert data into my database EVERYTIME and I mean EVERYTIME - This is the only code in the PHP file and it will place data in my database EVERYTIME. BTW I always make sure there is only one data entry in my database before I run the INSERT action file. CODE "A"<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?>If I put have CODE "B" as the only code in the PHP file it will delete the data but will not insert any new data.CODE "B"<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");mysql_close($con)?><?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?> So I played around with the code a little and I was able to make CODE "C" work and get the desired effect but CODE "D" & CODE "E" will not work. CODE "C"<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);}mysql_select_db("cp2000", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");mysql_query("INSERT INTO ViewIt (misc, CC) VALUES ('1', '2')");mysql_close($con)?>CODE "D"<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);}mysql_select_db("cp2000", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");$sql="INSERT INTO ViewIt (misc, CC) VALUES ('1', '2')";mysql_close($con)?> CODE "E"<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");mysql_close($con)?><?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);mysql_query("INSERT INTO ViewIt (misc, CC) VALUES ('1', '2')");mysql_close($con)?> I am left wondering why CODE "A" will work by itself but not with any other code - this is what is confusing me the most. I am also confused as to why CODE "C" will work and CODE "E" will not. I am guessing that has something to do with opening and shutting a connection.
  7. justsomeguy - I always appreciate your feedback so dont think I am trying to be difficult. Please understand what I am trying to get across to you. If the only thing in the php file is the following code it will send the data to the database everytime. (I check my database and it does have the information in it)<?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?>If i place that same code along with the DELETE code the INSERT action will NOT work... I just can't understand why...
  8. justsomeguy - O.K. so heres the problem... I get what you are saying but if I have the following code all by itself in a PHP file it works just fine. <?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?> But when I place the DELETE action with the INSERT action for some reason it does not work...
  9. fikiwan - Its the insert query that is the issue....justsomeguy - what exactly do you mean?
  10. Hello internet I am pulling out my hair trying to figure this one out. Below is the only code I have in the php file. What I am trying to do is delete the only line of data in the database table and replace it with a new line of data. The data will delete but it will not do the insert function to put the new data in. I started out trying an UPDATE function but that did not work either. Separately each set of <?php ?> code works if I put them in separate files but together they do not work. Why? How can I achieve the desired effect? Please help. <?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);mysql_query("DELETE FROM ViewIt WHERE misc='1'");mysql_close($con)?> <?php$con = mysql_connect("xxx","xxx","xxx");mysql_select_db("xxx", $con);$sql="INSERT INTO ViewIt (misc, CC)VALUES ('1', '2')";mysql_close($con)?>
  11. justsomeguy - thanks for responding.I realized that right after I hit POST... I am going to use mysql to pull the latest number and increment it that way.I meant IP tracking for unique IP addresses.
  12. Hello Internet.I am finally getting back around to this topic. I know this is about as simple as you can get but the code below works.I would like to be able to do a unique IP mapping but I don't know how this would work with the code I selected. Any ideas?I used the following code //used prior to <html> tag<?phpsession_start();if(isset($_SESSION['views']))$_SESSION['views']=$_SESSION['views']+1;else$_SESSION['views']=1;?> <html><head></head> <body>//used after <html> tag and within the <body> tag<?phpecho "Page Views ". $_SESSION['views'];?></body></html>
  13. Deirdre's Dad - Thanks.dsonesuk - As always thanks much! That did the trick!
  14. Are you saying that I cannot style an input to wrap text?Yes my original note said textarea (sorry for not pasting the right code) and I tried using text area instead of textbox but it still did not work. I used this code: THIS CODE IS IN THE <HEAD><style type="text/css">.commentbox {width:200px; height:72px}</style>THIS CODE IS IN A <FORM> WITHIN A <TABLE><tr><td align=center>Insert your Comments here:</td><td align=center><input type=textarea class="commentbox" maxlength="240" name="mbC" value=""></td></tr>
  15. THIS CODE IS IN THE <HEAD><style type="text/css">.commentbox {width:200px; height:72px}</style>THIS CODE IS IN A <FORM> WITHIN A <TABLE> <tr> <td align=center>Insert your Comments here:</td> <td align=center><input type=textbox class="commentbox" maxlength="240" name="mbC" value=""></td> </tr>
  16. I do not have a link yet. Preparing to launch the site at the moment...If it is the default way of handling wrapping how do I style it to get the desired effect?
  17. Hello internet. I am having an issue figuring out how to get text to type only in the visible text box on the screen and not scroll through on one line when typing. I have tried using textarea and placing callouts for wrap,rows,cols but that does not seem to work. How do I get the text to wrap? Here is my textbox code I have in the <head> tag BUT when text is being typed in the box it only shows on the first line. I want it to wrap in the text box on the screen. Please help. <style type="text/css">.commentbox {width:200px; height:72px}</style>
  18. Hello Internet. I would like to use the object tag to insert video into my website. I have been able to create video embedded into the website but have not found a way to have the video as a pop up when the website loads and give the user the option to "x" out of just the video clip. Please help! Thanks.
  19. dsonesukOn option#2 understood. On option#1 - I'm still a little confused where to apply that code. If I simply put that line of code in the <body> it ends up displaying those actual words in the browser and not a button at all. If i put that text within tags <input {-webkit-appearance........etc..... it does not render the buttons like I want them - it still defaults to what iphones want them to be... Please explain how and where to apply the code you suggested. Also I actually dont know what you mean by "jquery-mobile, with jquery-mobile-css" I am not using the command jquery anywhere in my code. Please explain what you mean by this statement. I would certainly appreciate it.Thanks as always Last question - do you like my anxiety face? It really fits how I feel most of the time!!!
  20. I ended up putting the code within the style quotes in the input tag. It worked. Guess I should have done that first. Issue solved! <input type="button" class="btnmain" style="-webkit-appearance: none; -webkit-border-radius: 0; font-weight: bold; font-family: Century; font-size: 12pt; margin-left: 0px;" value="item1" onclick="Senditem1();">
  21. Thanks again for responding to my post.I took a look with google and I found two sets of codes that claim to work. I guess I am not integrating the code properly to make either of them work. Can anyone help? OPTION1input, textarea { -webkit-appearance: none; -webkit-border-radius: 0;} OPTION2input[type=submit] { -webkit-border-radius:0px;}
  22. dsonesuk - Thanks for responding (as usual!) How might I go about placing my styles precedence over the default ones ipad uses?
  23. Thanks for responding to my post.Thats strange because a couple folks (including myself) have told me (the browsers on their iphones and ipads) that the buttons are rounded grey buttons. Could it be something else?
  24. Hello Internet!!! I am back for more questions and I continue to be confused and dazed. Here is the code for my button styles and they do not work with Safari browsers (i.e. iphones ipads, etc...) They seem to default to a rounded button that is gray. The text color appears to be ok with the button should have a background color and should be square. ***this code is in the <head><style type="text/css">.btnmain {background-color:#993300; color:#CC9966; width:258px; height:30px;}.btnmain:hover {color:Black; background: #CC9966; font-style: italic}.centerbtn {background-color:#993300; color:#CC9966; width:274px; height:33px;}.centerbtn:hover {color:Black; background: #CC9966; font-style: italic}</style>***this code is in the <body><input type="button" class="btnmain" style="font-weight: bold; font-family: Century; font-size: 12pt; margin-left: 0px;" value="item1" onclick="Senditem1();">
×
×
  • Create New...