Jump to content

LMarie

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LMarie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thats just what i needed Thank you for the help
  2. Maybe but iv done everything else so this is the only part missing. Does anyone know the regex to match paranteses and their text content?
  3. is not a college assignement.. im trying to make a sql table that contains sql querys and display the results in a html table when choosen. But i need to determine how many commas there is between select and from so that i can how many rows the table needs so i need to remove the paranteses and their content.
  4. hi.. my question is how do you use preg replace to remove paranteses and their content? the sentence is in this format test, test (test, test ,1 ,2), test i want to count commas but not the ones in paranteses so my solution is to remove that part of the sentence. Anyone that can help me with this? Thanks in advance
  5. When a query contains substring example: SELECT LastName, SUBSTRING(FirstName, 1, 1) AS Initial FROM Person.Contact WHERE LastName like 'Ba%' ORDER BY LastName;[/sub]
  6. I have a sql table containing id - query - query name the first page contains a drop down menu of all the query names. When chosen the user is sent to a page that prints the result of the query in a html table. Now i nees to find how many rows the table should have. This counts how many rows i need in the table: $parts=explode(' FROM ',$query); $count=explode(",", $parts[0]); $result=count($count); But the problem is that here i explode by commas but the query also contains commas like this: substring (***,19,10) as Part1 My question is how do i count only commas outside these parenteses. something like this: $var=0; start counting commas in parts[0], when ( accures increase $var to 1, if $var = 1 dont count commas, but when ) accures set $var to 0, and start counting again The reason why im making it this way is that it's suppose to be possible to just add a query to the sql table no matter how many rows this query needs in output. Any ideas?
  7. Hi... iv made an sql table that contains id number - name of sql query and an sql query. The problem is that the table contains very different querys. On the first page you choose a query from a drop down menu. When this is done i check if the query contains date as a parametre. if yes a date picker is desplayed. When a date is picked the report runs when submited. i want the results of the query to be displayed in a html table and need help to figure out how many rows the sql query output needs. For example select firstname, lastname from users needs two rows and select firstname, lastname, birthdate from users needs three rows. my solution is maybe to check how many commas the variable containing the query has between select and from any one know how this can be done in php or maybe have a simpler way of solving this?
  8. I fixed it header sorry for bothering you guys
  9. hi I have made a table (attachement) the users can update the sql database using + or x buttons. My problem is that the last row that was updated keeps on increasing/decreasing everytime i refresh the page. maybe its the post method that does it. But how do i prevent this from happening? Thankfull for any links to tutorials or code [attachment deleted by admin]
  10. Great.. It works. Thank you Much easier too. The script i used: <html> <head> <![if !IE]> <SCRIPT LANGUAGE="Javascript"> alert("You need to use IE 6 or above to get access to this service"); </SCRIPT> <![endif]> <!--[if lte IE 5]> <SCRIPT LANGUAGE="Javascript"> alert("You need to use IE 6 or above to get access to this service"); </SCRIPT> <![endif]--> </head> </html>
  11. Hi I have created a log in site for a service but the service only works for IE version 6 and up. I want the client to get a pop up if they are using a different browser or version. The first page contains a log on link that takes the user to a log in page where they fill out username and password. I want the error message to pop up when they get to this page. I have found a javascript on w3schools but it doesn't work as its supposed to. On w3 schools it said: "IMPORTANT! The version number is WRONG in IE 5.0 or later! Microsoft starts the appVersion string with the number 4.0. in IE 5.0 and IE 6.0!!! Why did they do that??? However, JavaScript is the same in IE6, IE5 and IE4, so for most scripts it is OK." http://www.w3schools.com/js/js_browser.asp The script: <html><head> <script type="text/javascript"> function detectBrowser(){ var browser=navigator.appName; var b_version=navigator.appVersion; var version=parseFloat(b_version); if ((browser=="Microsoft Internet Explorer") && (version=5)) { alert("OK"); } else { alert("Wrong browser or version!"); }} </script></head> <body onload="detectBrowser()"> </body></html> Is it possible to make som changes to this script to make it work? Iv tried to use http user agent but this only blocks firefox, and not opera and IE . Is it easier to user "user agent"? If so how do i block opera as well as firefox? Thankful for any tips
  12. im searching for match in a file not a database
  13. Hi iv created a drop down menu of users and a submit button. and this is what i want the submit button to do: when submit search file.txt for match in user if match then increase number for that user by one and write the new number to file.txt then rederect to a new page iv created the lines in file.txt looks like this: number:name:email any ideas or tips?
  14. Hi I need some help on a very easy scrip i think I want to make a table in php that looks something like the attachment. Iv got a text file that contains the names and default completed assignments (0). what I'm asking for is how do i get this value to increase by one when someone clicks the add button and wright the new sum to the text file? [attachment deleted by admin]
  15. Need help finding specific contents in a file (test.txt) and printing only the lines that contains this information. what iv got so far (iv marked where i have issues with #) <?php $fil = fopen('/home/www/test.txt', 'r'); while (!feof($fil)) { $line = fgets($fil); #each line in the file contains 8 fields, separated by :: example: 301::fshsfs::fsrsyshs:ofjfghdysb::5372928230) #if the line contains 301 in the first field then echo $line; else echo 'not available!'; } fclose($fil); ?> i want the result to be displayed in a table too :S
×
×
  • 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.