Cruddiy: a no-code Bootstrap CRUD generator

November 2020: Cruddiy now supports creating and deleting table relations (based on foreign keys) for cascading deletes/updates and and prepopulating select lists. Read more here.

So you have a MySQL database and a user who should be able to do some standard database actions, like Create, Read, Update or Delete database records. Nothing fancy.
And, this is a non-technical user, so you don’t want to give them access to phpMyAdmin, which is too difficult. Or let alone give them command line access. So you need some simple database forms, built on top of your MySQL database, but you also don’t want to handcode the same PHP CRUD pages again!

Now you can use Cruddiy (CRUD Do It Yourself) and quickly generate clean CRUD pages with zero coding.

You’ve probably seen pages like this a thousand times before. And if you have a MySQL database you can now make them yourself with just a few clicks.

Pages like these are generated without writing a single line of code. With proper titles, pagination, actions (view/edit/delete) and sorting included.

Above is the old Bootstrap 3 look. This is the new Bootstrap 4 look:

20200409-cruddiy-app-index.png (1157×729)
Cruddiy with Bootstrap 4 and search

I got tired of programming the same pages over and over again for some simple database forms. So in classic yakshaving fashion I decided to automate this, and built a generator that generates PHP CRUD pages.

Cruddiy is a no-code PHP generator that will generate PHP Bootstrap CRUD pages for your MySQL tables.

The output of Cruddiy is an /app folder which includes everything you need. You can rename and move this folder anywhere you want and even delete Cruddiy when you’re done (or run it a couple of times more to get your app just the way you like it). Cruddiy is only used to generate the /app folder. And the /app folder is what your user will use.

Why Cruddiy, tool xyz does the same thing!

Most MVC frameworks (e.g. Symfony, Django or Yii2) are of course also able to generate CRUD pages for you. I have used all of these. But usually you end up with at least 80 Megabytes of code (no joke) and with all kinds of dependencies that you need to deploy and maintain for just a couple of PHP pages! This rubs me the wrong way.
And of course there are many other PHP Crud generators around, but they are not libre or, more often than not, built on top other larger frameworks: so they have the same problem. Or they simply lack something else. So when I couldn’t find anyone that fit my needs I decided to make Cruddiy.

Cruddiy goals and characteristics

  • Simple
    • No dependencies, just pure PHP.
    • Written in PHP and output in PHP. When the generator runs correctly, your generated app will run correctly.
  • Clean
    • Just generate what’s needed, nothing else.
  • Small
    • If it wasn’t obvious from the above, the app it generates should be small. Kilobytes not megabytes.
  • Portable
    • Cruddiy generates everything in one single /app folder. You can move this folder anywhere. You don’t need Cruddiy after generating what you need.
  • Bootstrap
    • Bootstrap looks clean and is relatively simple and small. I use Bootstrap 3 because I like and know it a bit better than 4.

FAQ

Why PHP?

  • Love it or hate it: but PHP is ubiquitous. You can download Cruddiy on most webservers and you’re good to go. wget the zip -> unpack -> check webserver permissions (chmod) -> surf to the unpacked folder in your browser and follow instructions.
  • Cruddiy is of course a sort of templating engine. It stamps out code based on templates. And if PHP is anything, it is in fact by default a template engine itself. So it’s a pretty good language for this kind of thing.
  • Cruddiy only works with MySQL (for now): and MySQL and PHP are of course two peas in a pod.

Cruddiy does not follow the MVC paradigm!

Yes, looks elsewhere if you need this. This is not a framework.

Your code is full of dirty hacks

Sure, the generator does quite a bit of array mangling and dirty string replacement, but the PHP pages Cruddiy generates are as clean as they come. And when you’re done generating pages, you can just delete Cruddiy. It completely builds a self-contained portable app that will run on almost any webserver with PHP (i.e. most).

Your generated code is incomplete

At the moment what’s lacking is error value checking on database inserts/updates (all fields are required and it doesn’t check field types: integers vs dates etc.). These will throw general errors or don’t do anything at all. I will probably improve this, but for most use-cases (see above) this should not be a problem. The generated code does use prepared statements and should not be vulnerable to SQLi. But hey, please drop me a line if you find something!

Next features?

I might add these things:

  • Darkmode
  • Bootstrap 4 theme ✔️ Fixed per 20200803
  • Export to CSV or XLS (users probably want this more often than not)
  • Rearrange column order
  • Search records (at the top of the page) ✔️ Fixed per 20200722
  • User registration (simple table with username and password: .htaccess works for now)
  • Define table relations (use for cascading deletes etc.) ✔️ Fixed per 20201126
  • More specific field types (ENUM = drop-down list BOOLEAN = checkbox etc.)
  • More and better input validation
  • Catch more database errors
Cruddiy in action.

Also published on Medium.

61 thoughts on “Cruddiy: a no-code Bootstrap CRUD generator”

  1. hello, I’m still new to web programming. I have not mastered the use of php framework correctly. Every time I want to make a CRUD application I have to code every function needed. this also happens when updating / adding columns to the table. CRUDDY is very simple and helpful. this makes me excited again. thank you

      1. this is exactly what I have been wanting for YEARS! thank you. I am planning on modifying it a bit so I can use it as an include inside my existing bootstrap template

      2. Wow. Really thanks for this. Just like Mike, I have been wanting this for years. I had also started working on something similar on my own, but never got to it. I will make some minor mods to it, to use it inside my application, but it mainly cosmetics, nothing more. Thank you so much

      3. I really hope you keep working on this code because the competition is utterly garbage. All of them are bloated and requires additional libraries and frameworks to install. Some of us are still on shared hosting and using Composer or an entire web framework quickly turns into bloat and maintenance nightmare.

        I just spent the entire day trying out different CRUD solutions for PHP/MYSQL and yours was by FAR the easiest to install and use, like orders or magnitude easier. I love that you decide to not use composer or a web framework for your code; for once uploading a zip file and unzipping it actually installs an app.

        Unfortunately, I need to be able to specify relational logic and what not, so I can’t use your code. But please keep working on it! It’s really the best solution for simple CRUDs.

      4. Just WOW…..
        I’m an architecture student and I have a small project idea that involves creating different databases and I know how to do a simple CRUD, it takes me so much time…
        It works but is just too messy, every time I need to change something I have to almost start from 0.
        Cruddiy is just awesome, it works really well, it is easy to use and it looks soooo well.

        Thank you very much for the effort you put into this project!

        1. I have been checking the code and it is a masterpiece!
          I did some changes that maybe someone finds interesting:
          1st – I use some Boolean values and what I did is add another case in the update function that checks if the column is tinyint(1) then creates a dropdown with values 0 and 1. I think maybe this can help avoid inserting an invalid value.

          2nd – I added a small text next to the “# results” text that shows the Order and Sort so in case you are doing some stuff and come back to that tab you know how it was ordered.

          3rd – I made that the Update page returns the updated ID to the main page then there I check each row and if a row ID matches the updated ID I use the table-success class for that row. Using this you immediately see the updated record. I tested this for one page of results only, maybe the page number could be passed like Main page > Update page > Main page so it redirects you to the page where you updated the value.

          4th – I added a table-hover just in case the page has too many records.

          5th – I added a number type field in the index page of the set up where you can select the number of elements per page then this gets saved in the config file then I deleted the variable from the table-index page. So it is easier to modify the variable if it is in the small config file.

          6th – I added another case in the generator that searches for int (so it gets tinyint, int, smallint, bigint…) and then the field it created is a number one so it prevents you from entering a wrong value and it shows in red border and prevents you from submitting.

          7th – I am doing one modification that adds a small caption below the inputs in the update page that lets you know the allowed information and the max values so it is easier to identify.

          Well that is it for now, I really love your creation is just beautiful.
          Thank you very much.

            1. Hello, sorry to write the changes here, I still don’t know how to use GIT the correct way 🙁 I looked at the About page but the email link was broken.
              I am not sure if this will be correctly formated, if you see that it looks weird and you want you can send me an email and I will send you through email.

              1st – For the Boolean values and number fields (int, bigint…) I added this to the generate.php

              case (preg_match(“/tinyint\(1\)/i”, $columnname) ? true : false) :
              return 4;
              break;
              case (preg_match(“/int/i”, $columnname) ? true : false) :
              return 5;
              break;

              Next when creating the update fields I add this:

              case 4:
              $regex = “/'(.*?)’/”;
              preg_match_all( $regex , $columns[‘columntype’] , $enum_array );

              $create_html [] = ‘
              ‘.$columndisplay.’
              ‘;

              $create_html [] .= ‘ 0’;
              $create_html [] .= ‘ 1’;

              $create_html [] .= ‘

              ‘;
              break;

              case 5:
              $create_html [] = ‘
              ‘.$columndisplay.’
              <input type="number" name="'. $columnname .'" class="form-control" value="”>

              ‘;
              break;

              2nd – In the document templates.php after

              echo ” ” . $number_of_results . ” results”;

              I added:
              if(isset($_GET[‘order’]) && $_GET[‘order’]!=”){
              if(isset($_GET[‘sort’]) && $_GET[‘sort’]!=”){
              echo ” – Order by ” . $_GET[‘order’] . “” . $_GET[‘sort’] . ‘‘;}}

              3rd – In the template.php I changed this:

              if(!$stmt->execute([ {UPDATE_SQL_COLUMNS} ])) {
              echo “Something went wrong. Please try again later.”;
              header(“location: error.php”);
              } else{
              $stmt = null;
              header(“location: {TABLE_NAME}-index.php”);
              }

              into this:

              if(!$stmt->execute([ {UPDATE_SQL_COLUMNS} ])) {
              echo “Something went wrong. Please try again later.”;
              header(“location: error.php”);
              } else{
              $stmt = null;
              header(“location: {TABLE_NAME}-index.php?lastUpdated=$ID”);
              }

              Then in the template.php where the table is generated I added this so the row will be in green, the issue I thought about but I still haven’t tested is about passing the page so it redirects you to the exact page:

              while($row = mysqli_fetch_array($result)){

              if(isset($_GET[‘lastUpdated’]) && $_GET[‘lastUpdated’] == $row[‘{COLUMN_NAME}’]){echo “”;}else {echo ”;}

              4th – Just modified this:

              echo “”;

              5th – On the index page I added:

              Then on tables.php I modified this so the num of elements gets stored in config file:

              $txt .= “\$db_password = ‘$password’; \n”;
              $txt .= “\$no_of_records_per_page = $numrecordsperpage; \n?>”;

              On the template page I deleted the reference to this variable since it is linking to the config file it will get that value.

              6th – This was in 1st point

              7th – I was checking this but I still haven’t done it all. I created a function that will check the value of the column and return the min max values: I guess with regular expressions and with searching string you can find the exact type maybe for example INT then search for unsigned then you can choose the min max values.

              I just checked and the input field can have attributes Min and Max so it will also force you to use a valid number, I will try to figure it out and send it to you.

              8th This is a new feature that I thought about, I want to create a DB that has many relationships, something like RESOURCE has resource ID then there is another table URL that has information and Resource ID that must be one of the existing ones, it would be awesome if that could be set up too.
              Something like this column will depend on Resources.ID, I will look at it but that I will probably not be able to accomplish since my skills are not too good.

              Thank you very much and sorry about this long text, if it is better for you send me and email and I will send it better formatted.

              Thank you very much!

          1. Peter Häggstrand

            Jan, you saved my life!

            I have a huge collection of comics that I put in to a database (nerdy as hell). Mainly for my own use so that I could easily see if I already have that nice comic I stumbled across in a used comics store… And over the years I have been tinkering with different solutions starting with Excel, than Filemaker and moving to the old Dreamweaver MX database connectors (to have it online), over to Codeigniter when Dreamweaver stopped having a graphic interface. Sigh… all I needed was an easy way to write the basic code for listing all my comics, sort it, search, update and so on…and there you came!!! THANKS!

            Now I just need to solve uploading my scanned images so I don’t have to do that manually 🙂 Any tips would be appreciated.

            1. Hello, I saw your comment, it seems like a cool idea!
              One way I can think of is probably the old way: if you have this crud maybe you could use it to upload the images into the server and save in the database something like COMIC 1 > Picture comicpicture.jpg; So basically having a column that saves the picture name. I like to use only the picture name and format not the path so instead I write the path in PHP so if you ever change the folders you will only need to upload a few lines of code not every directory in your table. I hope that makes sense.

              Another easily way of batch matching the pictures depending if each comic just has one or more images. If the comic only has one image then you could do something like uploading all the pictures with the comic ID as the name so when you retrieve the info of Comic 1 with ID:XXXX you can call your image XXXX.jpg for example.

              If each comic can have more than 1 image and you want to avoid as much programming as possible maybe you could create a folder structure like for example: pictures > XXXX (Comic ID) and inside place all the pictures.
              When you retrieve the comic information you know you can also retrieve all pictures of the pictures/XXXX/ folder and it doesn’t even matter the format because you could pull file by file and display it.

              These are the easiest ways that I can think of and you wouldn’t even need to program too much php.
              You can use Cruddiy to manage the comics DB and from there you get the ID of the comic you want to add pictures to and using your host FTP or panel upload all the pictures to the folder with the ID as name.

              I hope it makes some sense what I wrote 🙂

          2. Next features, specially :
            1. Define table relations (use for cascading deletes etc.)
            2. More specific field types (ENUM = drop-down list BOOLEAN = checkbox etc.)
            Both needs drop-down with the value=key and name as display.

          3. Just what I was looking for!

            I added this code to show page numbers


            echo " " . $number_of_results . " results - Page " . $pageno . " of " . $total_pages;

            Thank you very much Jan van.

          4. Sebastian Steinhauer

            I use your solution for the backend of my own private finance reporting/dashboarding app. I really like it since I hope that the simple code will last a long time before I need to create the next iteration of the application. Fewer moving parts are a good thing in my book.
            However I do have a little bit of a feature gap I see. Currently you are identifying foreign keys, and their values are available in the edit pages, but not in the index and view pages. It would be cool if there was an automatic join happening before the visible fields are selected. This way I ended up touching the sql you generate manually – which works, but I wish it wasn’t necessary.

            Awesome work. Well done.

          5. perfect for a small side project, however…

            Notice: Undefined variable: column_id in C:\wamp64\www\issue\crud\generate.php on line 267
            Call Stack
            # Time Memory Function Location
            1 0.0007 371600 {main}( ) …\generate.php:0
            —————–

            No relations used when creating CRUD….

            Apache/2.4.46 (Win64) PHP/7.4.9
            Database client version: libmysql – mysqlnd 7.4.9
            PHP version: 7.4.9

          6. Hi, Thank you very much, excellent work. I have a problem with fks and dropdown, it shows only the id from the table, ex: 1 | , not gething the description column. the two table have pks and second fk. What iam doing wrong? Any step i have to do ? Thanks.

          7. Excellent script, worked perfectly.
            I had written my own CRUD but there are always little niggly problems to solve. I like what you’ve done better.
            I do have a suggestion for a future update. As it is I still have to go into PHPMyAdmin to do one operation – a copy operation that saves the new copy with a new ID, thereby inserting a new row with minimal data changes. I would love to see the same copy ability added to your script, or maybe you can simply show the code on your site and those of us who want it can insert it into your existing code.

          8. Since there’s no edit option for comments I am writing a second comment, you can merge it into the first if you want.

            I have 14 tables listed and the display of those table names is quite ugly – there are multiple rows with no space between the two rows (the blue buttons have no space between them between the rows of buttons). The buttons are centered in the page which is also rather ugly. I will be looking at the source code to see what I can do about fixing all of that.

            1. I edited the index.php file with the following code to place the many buttons in a more sensible manner. Obviously each person can build the index.php any way the want, just be sure to keep it saved because you will need it if you re-run the setup utility again. When you run the setup utility again this new customized index.php file will be overwritten. So, the solution to that is simple, just overwrite the new index.php with the the customized index.php.
              ——————————————————

              Web Site Administration

              Biography

              Blogs

              Links

              Nav menu

              Pages Hits

              Paging Buttons

              Songs

              Writings

              Colors

              Footer

              Header

              Meta Info

              CEH Blogs

              CEH Lessons

              1. Thanks Chip! That would be nice to incorporate in Cruddiy. But I think I lost the formatting because of the WordPress comment system, maybe you could make a pull request on Github?

            2. Thank you so much. You saved me hours of work,

              FYI I did find on glitch in search. With Server version: 10.2.37-MariaDB – MariaDB Server, the CONCAT on the search pages needs to be CONCAT_WS to see records where more than one exists. Hope this helps someone else.
              Cheers

            3. It looks very nice. However, I get this error when updating or adding records:
              [Fri Apr 09 23:17:20.559469 2021] [php7:error] [pid 17824] [client 192.168.10.69:58606] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: ” for column ‘created’ at row 1 in /var/www/html/app/contacts-update.php:42\nStack trace:\n#0 /var/www/html/app/contacts-update.php(42): PDOStatement->execute()\n#1 {main}\n thrown in /var/www/html/app/contacts-update.php on line 42, referer: http://192.168.10.108/app/contacts-update.php?id=12

              Could you please help me out with this?

              Thank you so much in advance

              1. It looks like you’re trying to add the date to a field that is of the ‘datetime’ format. MySQL expects this field to be of the format Y-m-d H:i:s (e.g. 2021-04-10 08:00:00). If it is not in the correct format MySQL will throw this error. This is not really a Cruddiy error, but a database error (Cruddiy could of course do a bit more error /type checking).

                For now: either use the correct formatting or change your database fieldtype to something else.

            4. Hi Jan and everybody..

              As a lot of folks before me already said, cruddiy is just what I was looking for.
              Great job! Very easy and direct to the task, without messing with frameworks and all that.

              I have been testing it for a little project I am doing, and I liked it very much.
              My PHP knowledge is a bit rusted and basic, but I am managing to advance on my project thanks to CRUDDY.

              I just found a couple of problems, not sure if they related to something on my setup or is something related to cruddiy.
              One of these issues I could solve touching the code, but the second one still there.

              1) As somebody already reported on the comments above, on a create record form, when retrieving values from a field coming from a foreign key, it only showed the first field (the primary key of the foreing value). To retrieve the name of the associated field (description for example) I have to comment out a line of the cruddiy code:

              file generate.php: removed the line “array_pop($row);” (appers only once on that file).
              Not sure what it does (remember my php knowledge is no deep), but with that change it finally showed me the name of the foreign field.

              2) I am not able to insert values on my tables. Only get empty values.
              For example, I have a very basic table with just two fields: id (integer, autoincrement, pk), and description (varchar).
              When I try to insert some value there, my description field stored on the database appears empty. The id (pk) with its autogenerated value is stored.
              If someone have some tip how to solve this, I would be very thankful.

              1. Thanks Ariel. I will have to look into the first mentioned problem.

                For the second, what is the actual query in the *-create.php code? Can you add items by hand / by executing this query by hand?

                1. Thanks Jan for your answer.

                  (https://pastebin.com/raw/CLCcYG3Q in case the following gets messed by wordpress)

                  My table name is called “estado” (status in spanish).

                  mysql> describe estado;
                  +————-+————-+——+—–+———+—————-+
                  | Field | Type | Null | Key | Default | Extra |
                  +————-+————-+——+—–+———+—————-+
                  | id | int(11) | NO | PRI | NULL | auto_increment |
                  | descripcion | varchar(45) | YES | | NULL | |
                  +————-+————-+——+—–+———+—————-+

                  The actual query on the file estado-create.php is:

                  $stmt = $pdo->prepare(“INSERT INTO estado (descripcion) VALUES (?)”);

                  If I run this “INSERT INTO estado (descripcion) VALUES (“test1″);” direct into my mysql console, the value is inserted.

                  Thanks again Jan.

                  1. Interesting! Try adding an extra field (even a dummy) somehow it works then!
                    There probably is a counter index thing that is wrong when there is but one field (and one auto_increment field).

                    I’ll have to debug that further.

                    1. Hi again Jan.
                      Thanks again for your answer.

                      I tried creating a new table with the following structure:

                      mysql> describe estado4;
                      +—————–+————-+——+—–+———+——-+
                      | Field | Type | Null | Key | Default | Extra |
                      +—————–+————-+——+—–+———+——-+
                      | id | varchar(45) | NO | PRI | NULL | |
                      | descripcion | varchar(45) | NO | | NULL | |
                      | otradescripcion | varchar(45) | NO | | NULL | |
                      +—————–+————-+——+—–+———+——-+

                      As you can see, this time no auto-increment, just three varchars fields.
                      But still I get the same problem: the values are stored as null on the database the first time. At the second try, as it would store a duplicate value, I get a Integrity constraint violation for the duplicate (empty) id field.

                  2. I found it! And fixed it: https://github.com/jan-vandenberg/cruddiy/commits/master

                    Thank you for pointing this out and being consistent about it, because this was a very real problem!

                    I recently pulled in some large pull requests from contributors and somehow / somewhere a couple of important variables got lost… Not good.

                    I have updated the code but will be checking if nothing else is missing, because I still cannot point exactly where these variables disappeared.

                    1. Great job Jan.
                      I already tested and it works!

                      Thank you again.
                      Best regards from Argentina 🙂

                  3. Absolutely brilliant! Thanks.
                    Getting this error in 2.2 :
                    Warning: count(): Parameter must be an array or an object that implements Countable in D:\Archive\cruddiy-2.2\core\generate.php on line 3

                    1. Thanks, it looks like you use Windows. I have heard this one before — also on Windows, so it must be related. But I can’t really reproduce it on my side (because I don’t have a Windows environment).

                    2. Warning: count(): Parameter must be an array or an object that implements Countable in /storage/ssd4/577/16916577/public_html/cruddiy-master/core/generate.php on line 3

                      1. Please fix this too… when I try to update record. I had to re-run cruddiy again to fix this.
                        But I have the dreadful feeling the below syntax error will come back to bite my ass in the middle of a production server transaction.
                        Please fix this too:-

                        Parse error: syntax error, unexpected ‘100’ (T_LNUMBER), expecting variable (T_VARIABLE) or ‘{‘ or ‘$’ in /storage/ssd4/577/16916577/public_html/cruddiy-master/core/app/table_video_address-update.php on line 15

                        Thank you my good friend.

                      2. Secondly, here is table_video_address-update.php…

                        false, // turn off emulation mode for “real” prepared statements
                        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, //turn on errors in the form of exceptions
                        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, //make the default fetch be an associative array
                        ];
                        try {
                        $pdo = new PDO($dsn, $db_user, $db_password, $options);
                        } catch (Exception $e) {
                        error_log($e->getMessage());
                        exit(‘Something weird happened’);
                        }

                        $vars = parse_columns(‘table_video_address’, $_POST);
                        $stmt = $pdo->prepare(“UPDATE table_video_address SET id_video_address=?,video_account_url=?,video_address=?,video_title=?,video_keywords=?,video_description=?,referred_similar_channels=?,copy_competitors_keywords=?,100_plus_likes=?,100_plus_shares=?,100_plus_subscribers=?,100_plus_comments=?,is_video_15m_long=?,keywords_in_video_text=?,keywords_in_audio_text=? WHERE id_video_address=?”);

                        if(!$stmt->execute([ $id_video_address,$video_account_url,$video_address,$video_title,$video_keywords,$video_description,$referred_similar_channels,$copy_competitors_keywords,$100_plus_likes,$100_plus_shares,$100_plus_subscribers,$100_plus_comments,$is_video_15m_long,$keywords_in_video_text,$keywords_in_audio_text,$id_video_address ])) {
                        echo “Something went wrong. Please try again later.”;
                        header(“location: error.php”);
                        } else {
                        $stmt = null;
                        header(“location: table_video_address-read.php?id_video_address=$id_video_address”);
                        }
                        } else {
                        // Check existence of id parameter before processing further
                        $_GET[“id_video_address”] = trim($_GET[“id_video_address”]);
                        if(isset($_GET[“id_video_address”]) && !empty($_GET[“id_video_address”])){
                        // Get URL parameter
                        $id_video_address = trim($_GET[“id_video_address”]);

                        // Prepare a select statement
                        $sql = “SELECT * FROM table_video_address WHERE id_video_address = ?”;
                        if($stmt = mysqli_prepare($link, $sql)){
                        // Set parameters
                        $param_id = $id_video_address;

                        // Bind variables to the prepared statement as parameters
                        if (is_int($param_id)) $__vartype = “i”;
                        elseif (is_string($param_id)) $__vartype = “s”;
                        elseif (is_numeric($param_id)) $__vartype = “d”;
                        else $__vartype = “b”; // blob
                        mysqli_stmt_bind_param($stmt, $__vartype, $param_id);

                        // Attempt to execute the prepared statement
                        if(mysqli_stmt_execute($stmt)){
                        $result = mysqli_stmt_get_result($stmt);

                        if(mysqli_num_rows($result) == 1){
                        /* Fetch result row as an associative array. Since the result set
                        contains only one row, we don’t need to use while loop */
                        $row = mysqli_fetch_array($result, MYSQLI_ASSOC);

                        // Retrieve individual field value

                        $id_video_address = $row[“id_video_address”];
                        $video_account_url = $row[“video_account_url”];
                        $video_address = $row[“video_address”];
                        $video_title = $row[“video_title”];
                        $video_keywords = $row[“video_keywords”];
                        $video_description = $row[“video_description”];
                        $referred_similar_channels = $row[“referred_similar_channels”];
                        $copy_competitors_keywords = $row[“copy_competitors_keywords”];
                        $100_plus_likes = $row[“100_plus_likes”];
                        $100_plus_shares = $row[“100_plus_shares”];
                        $100_plus_subscribers = $row[“100_plus_subscribers”];
                        $100_plus_comments = $row[“100_plus_comments”];
                        $is_video_15m_long = $row[“is_video_15m_long”];
                        $keywords_in_video_text = $row[“keywords_in_video_text”];
                        $keywords_in_audio_text = $row[“keywords_in_audio_text”];

                        } else{
                        // URL doesn’t contain valid id. Redirect to error page
                        header(“location: error.php”);
                        exit();
                        }

                        } else{
                        echo “Oops! Something went wrong. Please try again later.”.$stmt->error;
                        }
                        }

                        // Close statement
                        mysqli_stmt_close($stmt);

                        } else{
                        // URL doesn’t contain id parameter. Redirect to error page
                        header(“location: error.php”);
                        exit();
                        }
                        }
                        ?>

                        Update Record

                        Update Record

                        Please edit the input values and submit to update the record.
                        <form action="” method=”post”>

                        id_video_address
                        <input type="number" name="id_video_address" class="form-control" value="”>

                        video_account_url
                        <input type="text" name="video_account_url" maxlength="100"class="form-control" value="”>

                        video_address
                        <input type="text" name="video_address" maxlength="100"class="form-control" value="”>

                        video_title
                        <input type="text" name="video_title" maxlength="50"class="form-control" value="”>

                        video_keywords
                        <input type="text" name="video_keywords" maxlength="100"class="form-control" value="”>

                        video_description
                        <input type="text" name="video_description" maxlength="255"class="form-control" value="”>

                        referred_similar_channels
                        <input type="number" name="referred_similar_channels" class="form-control" value="”>

                        copy_competitors_keywords
                        <input type="number" name="copy_competitors_keywords" class="form-control" value="”>

                        100_plus_likes
                        <input type="number" name="100_plus_likes" class="form-control" value="”>

                        100_plus_shares
                        <input type="number" name="100_plus_shares" class="form-control" value="”>

                        100_plus_subscribers
                        <input type="number" name="100_plus_subscribers" class="form-control" value="”>

                        100_plus_comments
                        <input type="number" name="100_plus_comments" class="form-control" value="”>

                        is_video_15m_long
                        <input type="number" name="is_video_15m_long" class="form-control" value="”>

                        keywords_in_video_text
                        <input type="number" name="keywords_in_video_text" class="form-control" value="”>

                        keywords_in_audio_text
                        <input type="number" name="keywords_in_audio_text" class="form-control" value="”>

                        <input type="hidden" name="id_video_address" value="”/>

                        Cancel

                      3. cruddiy was amazing , Jan
                        this tools is awesome and save a lot of time.
                        I have a little problem, all pages that generated by cruddiy are work like magic in my laptop. but when I had uploaded all of generated files by cruddiy into my website, there were 2 (two) generated file which can not run correctly.
                        1. generated file with update function. When we wanna update the data, we used to click the pencil icon but its nothing happens and show HTTP ERROR 500
                        2. generated file with view function. When we wanna view the data, we used to click the pencil icon but its nothing happens and show HTTP ERROR 500
                        have any idea Jan, to solve my problem?
                        Thanks

Leave a Reply

Your email address will not be published.