joomla1.7 - joomla 文章中如何将数据插入数据库

标签 joomla1.7

我是 joomla 开发的初学者。我懂 PHP、MySql。但我想将数据插入到joomla的数据库(phpmyadmin)中。如何在 joomla 文章中做到这一点。谢谢

最佳答案

您可以通过这种方式在 joomla 中运行插入查询。

    $db =& JFactory::getDBO();
    $query = "INSERT INTO '#__example_table' ('name','email','username')
            VALUES ('John Smith','<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e58f8a8d8b96888c918da5818a88848c8bcb809d8488958980" rel="noreferrer noopener nofollow">[email protected]</a>','johnsmith')";
    $db->setQuery($query);
    $db->query();

关于joomla1.7 - joomla 文章中如何将数据插入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10757084/

相关文章:

Joomla,注册页面需要登录

php - 使用 PHP 在 Joomla 中获取用户类型

menu - 如何在不重新安装 joomla 组件的情况下添加新的管理菜单项?

php - com_users登录格式查看?

php - 登录 Joomla 平台 11 JLog

xml - Joomla 1.7 多个 SQL 列表在编辑时未预选

php - 如何通过 PHP 更改 Joomla 管理员 URL - 无插件

php - Joomla PHP : Checkbox won't uncheck

configuration - Joomla 文章无法使其对 SEO 友好

Joomla ACL : Only allow access to custom component in the backend?