Results 1 to 6 of 6
  1. #1
    Join Date
    May 2007
    Posts
    139

    Unanswered: I delete view from phpMyAdmin,well now I rerun php file but VIEW does not getRecreate

    I do a MYSQL VIEW I think via running a php file with

    Code:
    $active = 'active';
    $query_view2 = "CREATE VIEW admin_bookings2 (name,mob,fixed,cstatus,email,bookingid,dateplaced,status,datep,dated,Locationp,Locationd,days,mostdaysrate,vat,off,total,cat,discount2) AS
    SELECT $CustomersTable.name,$CustomersTable.mob,$CustomersTable.fixed,$CustomersTable.status,$CustomersTable.email,$BookingsTable.bookingid,$BookingsTable.dateplaced,$BookingsTable.status,$BookingsTable.datep,$BookingsTable.dated,$BookingsTable.Locationp,$BookingsTable.Locationd,$BookingsTable.days,$BookingsTable.mostdaysrate,$BookingsTable.vat,$BookingsTable.off,$BookingsTable.total,$BookingsTable.cat,$BookingsTable.discount2 
    FROM $CustomersTable, $BookingsTable
    WHERE $CustomersTable.email = $BookingsTable.email AND cstatus='active'"; //$CustomersTable.status = $active 
    //  ----------
    $result_view = @mysql_query($query_view2,$linkid);
    $query = "SELECT * FROM admin_bookings2 WHERE dated>='$today' ORDER BY $orderby "; // dateplaced  dated  AND dated>='$today'";  email='$email6' AND status!='canceled'   // appear bookings  dated>=time() AND time()<='$dated'canceled
    $result = @mysql_query($query,$linkid);
    $count = @mysql_num_rows($result);
    echo "  ( Your query returned " . $count . " items. )";
    ?>
    but I delete it from phpMyAdmin by error, well now I return to php file but VIEW does not get recreated, what to do ?

    in php file appears:

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/content/p/o/l/polisch123/html/administration/bookings10nov2008.php on line 213

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    why are you creating the view in php?

    as for the "not a valid MySQL result resource" error message, this is a php error message and not a mysql error message, so we can't help you here
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    May 2007
    Posts
    139
    How I create a MYSQL VIEW ? I have a phpMyAdmin DATABASE ?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by lse123
    How I create a MYSQL VIEW ?
    with a CREATE VIEW statement
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    May 2007
    Posts
    139
    In phpMyAdmin how exactly ? execute statement from "SQL BOX"/SQL MENU in phpMyAdmin ?

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, in the SQL tab/box/window
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •