Jump to content

Maheshwaran

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Maheshwaran

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. My idea is change the datalist based on Textbox. # when textbox is empty, I want to display "initial,always" # when textbox is select "initial or awlays" and datalist should show "LHS,RHS". # again the textbox is empty, I want to show "initial,always". Here the second scenario is showing only "initial" and when Textbox empty it showing "initial,always,LHS,RHS". can you please give me some hint? <!DOCTYPE HTML> <html> <head> <title> JQuery | Set value of input text. </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"> </script> </head> <body style="text-align: center;"> <input id="input" list="anrede" /> <datalist id="anrede"> </datalist> <br> <br> <script> var mycars = new Array(); var block = new Array(); mycars[0] = 'initial'; mycars[1] = 'always'; block[0] = 'LHS'; block[1] = 'RHS'; var options = ''; $("#input").click(function(event) { $('#anrede').empty(); var option = ''; if ($('#input').val()=='') { for(var i = 0; i < mycars.length; i++) options += '<option value="'+mycars+'" />'; $('#anrede').append(options); } else if ($('#input').val()=='initial') { for(var ii = 0; ii < block.length; ii++) { options += '<option value="'+block[ii]+'" />'; $('#anrede').append(options); } } }); </script> </body> </html>
  2. I trying to update table where the data is coming from PHP. Here the submit button and table are in different frame. I have attached example code. can you please help me to update table when click submit button? Thanks, Maheshwaran B frame.html frame_a.html frame_b.html head.html tmp.php
  3. Hi, I am trying to searching order of string match in PHP. I tried "preg_match_all" and it's works some case and not someother case. <?php $sd = "2:Inst:(Inp:low:():high:(UnDri)),.(Inp:low:(concat():high:(UnDriven)),.(Inp:low:((((1))((1)))):high:((Constant))),."; // this should not match.. $sd = "2:Inst:(Inp:low:():high:(UnDri)),.(Inp:low:(():high:(UnDriven)),.(Inp:low:((concat((1))((1)))):high:((Constant))),."; // This should match $tu = "(\binst\b)(,)(\blow\b)(.*)(\bconcat\b)(.*)(\bhigh\b)(.*)(\b(Constant)\b)"; if (preg_match_all("/$tu/i",$sd,$out,PREG_SET_ORDER)) { echo "GUI : $sd\n"; } else { } ?> Thanks, Maheshwaran B
  4. Maheshwaran

    Perl+SQL

    Hi , Do you have sample example? I tried and I am not able to get sample example? SQLIte does not have if statements. It also does not have an information_schema database. It seems like you found something that works in MySQL and you're assuming that it's also going to work in any other database, and that's not true. It looks like you need to use the table_info pragma to get information about a table, which will return one record per column in the table. Look through those results to see if the column exists and then alter the table if not. https://www.sqlite.org/pragma.html#pragma_table_info
  5. Maheshwaran

    Perl+SQL

    How about the performance?
  6. Maheshwaran

    Perl+SQL

    Hi , Thanks for reply. Is there way to add new column in table if the column is not present using perl? Thanks, Maheshwaran V
  7. Maheshwaran

    Perl+SQL

    Hi, I am getting following error when I try to add new column if the column not present. can you please point me the error? my $driver = "SQLite"; my $database = "tcc.db"; my $dsn = "DBI:$driver:dbname=$database"; my $userid = ""; my $password = ""; my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 }) or die $DBI::errstr; my $stmt = qq(CREATE TABLE ddc (reg_name TEXT PRIMARY KEY UNIQUE NOT NULL );); my $p1 = "Col1"; $rv = $dbh->do(" IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = ddc AND COLUMN_NAME = $p) BEGIN ALTER TABLE ddc ADD $p END") or die $DBI::err; DBD::SQLite::db do failed: near "IF": syntax error
×
×
  • Create New...