in reply to help! cgi dbi

Post some code! :)

Replies are listed 'Best First'.
Re: Re: help! cgi dbi
by daveh71 (Novice) on Apr 17, 2001 at 02:52 UTC
    i don't know where to begin posting code. Here's one snippit
    if ($D::table == /client/i) { $sth_clients = $dbh->prepare_cached("select * from client" +); $sth_clients -> execute; while (@info = $sth_clients->fetchrow_array) { #make a has +h table...yahoo!!! $clients{$info[0]} = $info[1]; } $sth_clients ->finish; } #getlist of projects that are active $sth_project = $dbh->prepare_cached("select * from project + where active=1"); $sth_project -> execute; while (@info = $sth_project->fetchrow_array) { #make a has +h table...yahoo!!! $projectList{$info[0]} = $info[1]; } $sth_project ->finish; &DisconnectDB; print "<FONT face='Arial' size=2><b>ADD $table ";
    keeping everything else the same, if I put the second halfin an else block(below) the script locksup in the browser.
    if ($D::table == /client/i) { $sth_clients = $dbh->prepare_cached("select * from client" +); $sth_clients -> execute; while (@info = $sth_clients->fetchrow_array) { #make a has +h table...yahoo!!! $clients{$info[0]} = $info[1]; } $sth_clients ->finish; } else { #getlist of projects that are active $sth_project = $dbh->prepare_cached("select * from project + where active=1"); $sth_project -> execute; while (@info = $sth_project->fetchrow_array) { #make a has +h table...yahoo!!! $projectList{$info[0]} = $info[1]; } $sth_project ->finish; } &DisconnectDB; print "<FONT face='Arial' size=2><b>ADD $table ";
    thanks
      if ($D::table == /client/i) {
      You probably mean:
      if ($D::table =~ /client/i) {
      Also, make sure you are using -w and use strict; as that might help you find more errors.
      Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain