1

I am new to phpmyadmin and mysql. I have created a localhost Wordpress community website where users can upload posts. I need to get access at the text of every post they upload via phpmyadmin because I want to connect the website with an android app. What I can't figure out is why the text field is shown as NULL but in the site it appears correctly. Here is an image to let you know what I mean.

This is how it appears on phpmyadmin: [1]: https://i.sstatic.net/vxiTg.png

And this is how it is shown on the website: [2]: https://i.sstatic.net/b8aCY.png

So, if I try to synchronize these data with SQLite will it pass the data or will it turn NULL?

5
  • 1
    Maybe, you are open the wrong table in phpMyAdmin. Maybe website were cache or using template instead of retrieve the real data from DB. You are opening insert tab in phpMyAdmin instead of edit any exists. Learn more about how to ask
    – vee
    Commented Nov 23, 2021 at 3:04
  • “if I try to synchronize these data”… did you try?
    – Chris Haas
    Commented Nov 23, 2021 at 4:38
  • 1
    @vee I see, thank you for your information. I appreciate your answer. Commented Nov 23, 2021 at 14:33
  • @ChrisHaas yeah, I tried to synchronize them but I couldn't understand how to turn these data from NULL to the original text. Commented Nov 23, 2021 at 14:34
  • Turning null to original text, is like trying to convert a zero byte zip file back to the original document. Null is the absence of data.
    – Chris Haas
    Commented Nov 23, 2021 at 14:36

1 Answer 1

0

You're asking several separate questions that when combined seem to be a little confusing to me, but I'll try to address them all and then attempt to answer your overall problem.

Is there a way to decrypt a NULL text?

If something is NULL, that means there is nothing stored there. It's distinct from storing an empty string or a 0, because if you're storing a price list for instance, a 0 means the price is zero, but a NULL value means the price hasn't been set. In some cases, it doesn't make sense to allow a NULL (for instance, in a user registration page you might need an email address as a unique identifier, in which case a NULL email address would be problematic). There's no encryption involved with inserting a NULL value. When defining or editing a column, you can tell MySQL/MariaDB whether to allow NULL values.

I need to get access at the text of every post they upload via phpmyadmin

Your users should not be using phpMyAdmin directly. You can have them submit information via WordPress or some other software, or even a custom form, but phpMyAdmin is not mean for end users to send you data.

because I want to connect the website with an android app.

The usual way of getting an app to connect to the database that backs a website is to expose an API on the web server that the app can access. You won't be able to easily access the database directly from the Android app.

What I can't figure out is why the text field is shown as NULL but in the site it appears correctly.

The image you posted is of the phpMyAdmin Insert tab, where you add new data; if you go to the Browse tab you'll see your "Hello World!" text

So, if I try to synchronize these data with SQLite will it pass the data or will it turn NULL?

Why are you trying to synchronize your database to SQLite? How are you going to do that? I think you should pick one database and stick to that rather than trying to synchronize between two systems that have rather different features. Whether it will properly handle NULL values will depend on how you're handling the synchronization. SQLite does allow NULL values, but whether it will cleanly synchronize will depend more on how you're linking the two systems than on the capabilities of each individual database system.

Now I think you need to look at what you're trying to accomplish here, because the complexity of synchronizing the two databases plus trying to connect directly to MySQL from an Android app means to me that whatever you're working on is currently pretty fragile and probably some parts should be rethought.

5
  • Alright, I appreciate your help. You were very clear. Let me ask some questions on what you wrote above because I am new to phpmyadmin. I use wordpress and peepso plugin.As a matter of fact PeepSo hasn't got any API available.That's why I want to do it myself,to create an API so that I can be able to connect the databases of my website with the databases of the android app .That's why I wanted to synchronize SQLite with those data.Sorry for any silly queries but I a newbie on PHP and SQL😅 Commented Nov 23, 2021 at 22:20
  • I believe you're talking about putting SQLite in the Android app and then synchronizing the phone's local database to the one in MySQL, is that correct? Synchronizing data is a big design undertaking, much more common is to make the app work online only (so any transactions happen immediately on the server and you don't have to synchronize anything). You'll probably end up writing some simple PHP script that takes an argument and does something with it. You might want to authenticate the user first. Your app will then access those URLs with the proper data. You probably want a guide on REST. Commented Nov 23, 2021 at 22:51
  • REST is a common methodology of implementing an API; the client can get or set information based on the URL and data that's encoded along with the request. The details of the API will depend a lot on what you're trying to implement, and some programming languages make it pretty easy, but I don't have a good guide to point you towards. Commented Nov 23, 2021 at 23:26
  • Thank you very much for your information. So, if I understand well you mean that the best way is to store the website data to SQLite, right? Commented Nov 28, 2021 at 22:14
  • No, I'd keep the website on a larger database platform like MySQL or MariaDB; SQLite is great for what it is but wouldn't scale well as your site grows. Commented Nov 29, 2021 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.