• Member Avatar for AndrisP
    AndrisP

    Replied To a Post in insert into table from another table mysql

    DROP TRIGGER IF EXISTS after_insert_event; DELIMITER $$ CREATE TRIGGER after_insert_event AFTER INSERT ON event FOR EACH ROW BEGIN INSERT INTO guest (event_id, event_name) VALUES (NEW.event_id, NEW.event_name); END; $$ And check …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in insert into table from another table mysql

    trigger you write once and it is stored in the database
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in insert into table from another table mysql

    Something like this: CREATE TRIGGER after_insert_event AFTER INSERT ON event FOR EACH ROW BEGIN INSERT INTO guest (event_id, event_name) VALUES (NEW.event_id, NEW.event_name) END; but your first example not correct "INSERT …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Oracle query doesnt work when i click submit

    Hi Folks, I am having problem with my web design. I am making a query that involves two table but it doesnt do anything when i click submit. do i …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Oracle query doesnt work when i click submit

    Put after line 17: if(!$requestCompParse){ $e = oci_error($conn); echo "Parse error: ".$e['message']; } replace line 19 to: $ex = oci_execute($requestCompParse); and put after line 19: if(!$ex){ $e = oci_error($requestCompParse); echo …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching insert into table from another table mysql

    hey guys, so i'm trying to insert data from one table to another. table 1: |event_id|event_name|start|end|event_venue| table 2: |guest_id|guest_name|event_id|event_name| $event = mysql_query("INSERT INTO event VALUES('','$name','$dstart $tstart','$dend $tend','$venue')"); $insertg = mysql_query("INSERT …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in insert into table from another table mysql

    Would not it be more convenient to use a trigger?
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in GET the total sum of the Radio Button Value

    And by the way **ID and NAME tokens must begin with a letter** ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in GET the total sum of the Radio Button Value

    <?php $array = array( array(0.8, 1.2, 2.4, 3.2, 4), array(2, 4, 6, 8, 10) ); echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; for($a=1; $a<=5; $a++){ $arr = ($a>1?$array[1]:$array[0]); foreach($arr as $key => $val){ …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in GET the total sum of the Radio Button Value

    Use checkbox instead of radio Something like this: <?php $array = array( array(0.8, 1.2, 2.4, 3.2, 4), array(2, 4, 6, 8, 10) ); echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; for($a=1; $a<=5; $a++){ …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching GET the total sum of the Radio Button Value

    Hello Guys, I have a radio button has a different value i dont know how to get the sum of this. can you give me some ideas? or sample code? …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in GET the total sum of the Radio Button Value

    <?php $id = 3; // e.g. value of checked for($i=1; $i<=5; $i++){ $checked = ($id==$i?" checked=\"checked\"":""); ?> <input type="radio" class="css-checkbox" id="1radio<?=($id);?>"<?=$checked;?> name="<?=($id);?>" value="<?=$i;?>"> <label for="1radio<?=($id);?>" class="css-label"><?=$i;?></label> <?php } ?> What …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching replace text between to substrings

    how to `.replace()` the `'error'`? only use `a` and `b` var str = 'bla bla anything error anything bla bla'; var a = 'anything', b = a; im not good …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in replace text between to substrings

    `var a = str.replace(/error/,'my replace')` or `str.replace(/anything.*anything/,'anything my replace anything')` if I understand correctly
  • Member Avatar for AndrisP
    AndrisP

    Began Watching retrieve data from database using drop down list

    Dear All, im testing out a way to get data from database depending on the drop down selection and displaying the data into a table by using php. now my …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in retrieve data from database using drop down list

    Cut line 2: `$place = mysql_real_escape_string($_POST['place']);` and write after check `isset()` (line 4): `if(isset($_POST['place']))`
  • Member Avatar for AndrisP
    AndrisP

    Began Watching unhandled exception error? cant seem to solve a tiny error!

    hi so this project requires an input of U, M, or D and as many as you like of them (i think, might be only up to 100 based on …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in unhandled exception error? cant seem to solve a tiny error!

    `swap()` is C++ built-in function
  • Member Avatar for AndrisP
    AndrisP

    Began Watching xml stylesheet

    hi sir! little bit lost Pls help! how can I add css file for may xml created from php? <?php bla bla bla..... ---------<?xml-stylesheet type="text/css" href="markers.css"?>-------how can i add this …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in xml stylesheet

    Link to css file put in XSLT file, like: <?php header("Content-type:text/xml;charset=utf-8"); print "<?xml version=\"1.0\" encoding=\"utf-8\"?> <?xml-stylesheet type=\"text/xsl\" href=\"transform.xsl\" ?>"; echo '<markers>'; while ($row = @mysql_fetch_assoc($result)){ echo '<marker '; echo 'name …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching How to use the & in xml formate

    Helo friends i am trying to use the XML file to send data to api but i am getting a error due to & character used in link Where (XXXXXXXX&apiToken=XXXXXXXX&payload=) …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in How to use the & in xml formate

    &amp;
  • Member Avatar for AndrisP
    AndrisP

    Began Watching cant open php file

    hello i have create some webpages they work and are nice but when i click in contat form which contain php code inside it display all code which are inside.
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in cant open php file

    Write PHP header and XML header in line 65 `header("Content-type:text/html;charset=utf-8");` `print "<?xml version=\"1.0\" encoding=\"utf-8\"?>";`
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in prime numbers

    Yes, iamthwee. Congratulations!
  • Member Avatar for AndrisP
    AndrisP

    Began Watching prime numbers

    create a program to print all prime numbers between 1 to 100.
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in prime numbers

    #include <iostream> using namespace std; bool IsPrime(int number) { for (int i=2; i<=number/2; i++) { if (number % i == 0) return false; } return true; } int main() { …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching how to use trigger

    I've created student table with student id , first name and last name .I've alos create trigger to generate student id however when I want to inserte data to the …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in how to use trigger

    It should be ok if SID is auto_increment or is default value for SID, but ERROR if not
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Swaping two numbers

    Write a program to swap two values so that what is in Value1 would be interchanged with what is in value 2
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Swaping two numbers

    C++ bult-in function #include <iostream> using namespace std; int main() { int a,b; cin >> a; cin >> b; cout<< "Numbers are " << a <<" "<< b <<endl; swap(a,b); …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Help with code error, OOP

    Hi All, I am having trouble trying to locate the problem with this code. When I run it I get the follow error "First-chance exception at 0x0FADA9E8 (msvcr120d.dll) in ConsoleApplication2.exe: …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Help with code error, OOP

    Arranged brace in line 107
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    e.g. <?php // put php script - functions classes, methods etc header("Content-type:text/html;charset=utf-8"); print "<?xml version=\"1.0\" encoding=\"utf-8\"?> "; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="lt"> …
  • Member Avatar for AndrisP
    AndrisP

    Began Watching shell

    Hi all, I want to write a script to do the following job I have a record like day ID var Month 1 11 x March 2 11 y April …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in shell

    You can use crontab http://www.adminschoice.com/crontab-quick-reference/
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    Yes of course. See my comment above.
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    Yes of course. See my comment above
  • Member Avatar for AndrisP
    AndrisP

    Began Watching date range

    hi everyone am a novie in php world. i was asked to creat a database and a table which i did but now i created a form which has the …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in date range

    exact match $sql = "SELECT * FROM mytablename WHERE `fullnames` = '$searchname'"; or search by name parts $sql = "SELECT * FROM mytablename WHERE `fullnames` LIKE '%$searchname%'";
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    HTML - Hyper Text Markup Language, it is not script! Impossible to check text file without php.
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    Put function to beginning of this file, <?php function parsefile($filename){ $file = @file($filename); while(list($key,$val)=each($file)){ $line = explode(";",$val); if($line[1]==$_SERVER['REMOTE_ADDR']) return true; } return false; } header("Content-type:text/html;charset=utf-8"); ?> edit lines 90-100 <div …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    check IP address if (parsefile("konkursas.txt")){ echo "Error message"; } else { echo "<form> ..... </form>"; }
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Im Looking for a button hit counter... HELP?

    Hello, my website is created almost intirely in php, its dynamic and we have everything working under mysql database. It has printable cuppons for free, the coupons are inside a …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Im Looking for a button hit counter... HELP?

    You can use trigger in database. If you have not previously used read this: http://dev.mysql.com/doc/refman/5.6/en/trigger-syntax.html
  • Member Avatar for AndrisP
    AndrisP

    Began Watching Responsive website column background color

    Hi, I am using a responsive website to make a site which is here - http://rwgraphicdesign.com/Smith/index2.html What I want to do is have the last column ONLY, which lists the …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in Responsive website column background color

    use `td:last-child` in css
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    if you save in file as <?php fwrite($file,$email.";".$_SERVER['REMOTE_ADDR'].";".PHP_EOL); ?> you can use this function <?php function parsefile($filename){ $file = @file($filename); while(list($key,$val)=each($file)){ $line = explode(";",$val); if($line[1]==$_SERVER['REMOTE_ADDR']) return true; } return false; …
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    for example: RewriteEngine on RewriteCond %{REMOTE_ADDR} ^127.0.0.1$ RewriteRule !(^ban_page.html) /ban_page.html [R]
  • Member Avatar for AndrisP
    AndrisP

    Replied To a Post in please need help html form

    Not need input field "ip" in form - user can change it. <?php if (isset($_POST['submit'])) { $file = fopen('konkursas.txt','a+'); $email = $_POST['nail']; fwrite($file,$email." [".$_SERVER['REMOTE_ADDR']."]".PHP_EOL); fclose($file); print_r(error_get_last()); header("Location: http://www.mypage.com") ; } …

The End.