If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > I delete view from phpMyAdmin,well now I rerun php file but VIEW does not getRecreate

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-09-08, 08:58
lse123 lse123 is offline
Registered User
 
Join Date: May 2007
Posts: 139
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
Reply With Quote
  #2 (permalink)  
Old 11-09-08, 09:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-09-08, 15:08
lse123 lse123 is offline
Registered User
 
Join Date: May 2007
Posts: 139
How I create a MYSQL VIEW ? I have a phpMyAdmin DATABASE ?
Reply With Quote
  #4 (permalink)  
Old 11-09-08, 15:10
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Quote:
Originally Posted by lse123
How I create a MYSQL VIEW ?
with a CREATE VIEW statement
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 11-14-08, 16:19
lse123 lse123 is offline
Registered User
 
Join Date: May 2007
Posts: 139
In phpMyAdmin how exactly ? execute statement from "SQL BOX"/SQL MENU in phpMyAdmin ?
Reply With Quote
  #6 (permalink)  
Old 11-14-08, 16:33
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
yes, in the SQL tab/box/window
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On