I'm facing a strange problem to be honest, this is the first time that I have a prepared statement on the same php page I try to reuse In this case, I really need this because the solution of two identical statements with different variable names seems redundant. Anyways what I am doing
$ mysqli = new MySQLi (HOST, USER, password, database); $ Image_from_database = $ mysqli- & gt; Ready (select "slider_id, slider.images_id, images.images_id, images.image_name, images.image_path, images.image_type, images.image_size, image_tag_name, image_tags.date slider, images in the slider from the left .images_id = images .images_id LEFT JOIN image_tags image_tags.images_id = images.images_id "); $ Image_from_database- & gt; Bind_result ($ sliderID, $ sliderImageID, $ imageID, $ imageName, $ ImagePath, $ imageType, $ imageSize, $ tagname, $ tagDate); $ Image_from_database- & gt; Executed (); $ Image from_database- & gt; Store_result ();
Then for the call:
& lt; Div class = "large -6 column" & gt; & Lt; Fieldet class = "slider_control" & gt; & Lt; Legend & gt; Images from database & lt; / Legend & gt; & Lt; Div class = "slider_image_edit" & gt; & Lt; Div class = "slider" & gt; & Lt ;? While php ($ image_from_database-> fetch ()) {if (empty $ sliderID)!) {Echo '
Then on the page I want to display results in the table instead of an image slider ...
Select various images to edit gt; & lt; Legend & gt; You can see the slider to see the order that they are & lt; / legend & gt; & gt; form action = "method" = "Post" enctype = "multipart / form-data"> gt; & lt; table & gt; & lt; thead & gt; & lt; th & gt; id & lt; / Th & gt; & lt; th & gt; Names & lt; / th & gt; & lt; th & gt; tags & lt; / th & gt; & lt; th & gt; & lt; / th & gt; Gt; & lt; th & gt; Size & lt; / th & gt; & lt; th & gt; Edit & lt; / or & gt; & lt; th & gt; delete & lt; / th & gt; ; & Lt; / thead & gt; & lt; tbody & gt; Php $ image_from_database- & gt; Execute (); while ($ image_from_database- & gt; fet ()) {echo '& lt; Tr & gt; & lt; TD & gt; "'$ SliderID.'" & Lt; / TD & gt; & Lt; Td> "$. $ ImageName." "& Lt; / td> gt; & lt; td & gt; $ Tagname. "" & Lt; / Td> & Lt; Td> "$ ImageType." "& Lt; / td> gt; & lt; td & gt; $ ImageSize. "" & Lt; / Td> & Lt; TD & gt; Edit & lt; / TD & gt; & Lt; TD & gt; Remove & lt; / TD & gt; & Lt; / TR & gt; '; }? & Gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Fieldset & gt;
When I load the page, the slider will be displayed completely with all the related images, but on the list it will display only the last line of the table in this particular example, it displays some Such as:
id name tag type edit type delete "2" "bf535be38b469cfbcf6db6d02ba3a9d0.jpg" "college and program" "image / JPEG" "82993" delete edit "2" " Bf535be38b469cfbcf6db6d02ba3a9d0.jpg "" Colleges & amp; Programs "" image / jpeg "" 82,993 "no. Edit Delete
To delete and not delete anything at this time, they are just looking at what I want later as the placeholder.
Anyway, can anyone tell me why the first part of the query page but not the second one?
The reason for this is that you have already displayed all the records and the array from the database you already have It has ended. So when you say it again, it will start with the last.
Did Jeron tell you, store results in a variable or something and then reset it.
Comments
Post a Comment