Jump to content

ajaxStardust

New Members
  • Posts

    9
  • Joined

  • Last visited

ajaxStardust's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Unable to launch selected browser (Chrome). Error: Command failed: google-chrome "http://[...snip...]usergroup.php" /bin/sh: 1: google-chrome: not found /bin/sh: 1: google-chrome: not found There is no problem. Windows does not interpret the path as a valid path to an executable at /bin/sh . Additionally, there is no windows executable binaries there for it to run.
  2. Version: 1.71.2 (user setup) Commit: 74b1f979648cc44d385a2286793c226e611f59e7 Date: 2022-09-14T21:03:37.738Z Electron: 19.0.12 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.22622 Sandboxed: No Visual Studio Code on Windows 11. Greetings. I tend to have the most success with debugging, and remote connections using VS Code. I have a LAMP stack setup on a Linux box on my LAN, so most of my php dev work is done via SSH / SFTP connection to that server. It takes some tweaking, but you can get the extension Open PHP/HTML/JS In Browser to work with that setup and preview files without a hitch if the setup is \\canonicalname\htdocs , but it doesn't want to recognize /usr/bin/php as a valid executable for PHP features of VS Code. If configured with IP address as an SSH connection/ workspace, it will recognize /usr/bin/php , but it won't open PHP in browser, because it's sending commands as linux bash commands in that setup. Unable to launch selected browser (Chrome). Error: Command failed: google-chrome "http://10.0.0.01/wp_somesite/wp-content/plugins/wp-list-table/inc/admin/views/smsusergroup.php" /bin/sh: 1: google-chrome: not found /bin/sh: 1: google-chrome: not found Does anyone use that extension and have a recommendation for a functional configuration that will still open the files in a browser with a windows-friendly command?
  3. Eureka! I was testing that query on 2 different databases. Turns out, I didn’t update the credentials for one of the two after some table tweaking, so... doh! That was just a stupid oversight on my part. $wpdb was working all along. Thank you for reading, and the reply nevertheless.
  4. This SQL query is is for a WordPress (WP) plugin ideally, whereby WP has it's own database abstraction, the $wpdb class . I would prefer to use $wpdb for extensibility / forward compatibility, but I can't get my SQL to work with it. Not super WP savvy yet, I regret. I couldn't get my query to work with mysqli testing with a simple query (as I did with PDO per suggestions, here), but perhaps $wpdb might accommodate. Testing with var_dump(), the result returns array(0) and I've tried various permutations of the $wpdb methods without success. Is there a recommended way of testing the MySQL query with PHP, outside of just reloading the page in the browser?
  5. @ginerjm This was just to test the data access / result set. nothing more. Now that I have that, I'm good to go. Thank you all!
  6. Thank you, all! PDO is definitely what I needed here. @Barand This is what I came up with. I've got my values. I really appreciate the insightful, useful replies here! ...AND (Name.value!='Retiree' OR Nmbr.value = '1') ORDER BY Name.value DESC"); $name_val = $pdoConn->bindValue(":Name_value", 32); $nmbr_val = $pdoConn->bindValue(":Nmbr_value", 10); $tryPrint = array(); $pdoConn->execute(); while($row = $pdoConn->fetch(PDO::FETCH_ASSOC)){ $tryPrint[] = $row; } foreach($tryPrint as $try_row => $try_val){ print "Row $try_row: <br>"; print "Name: ".$try_val['Name_value']."<br>"; print "Nmbr: ".$try_val['Nmbr_value']."<br>"; }
  7. @ginerjm @Barand It's really just at a very beginning stage of testing: function getSMSUsers($conn) { $res = $conn->query("SELECT DISTINCT Nmbr.uid as Nmbr_uid, Nmbr.fid as Nmbr_fid, Nmbr.value as Nmbr_value, Name.fid as Name_fid,Name.value as Name_Value, u.uid as u_uid, u.status as u_status,Name.uid as Name_uid FROM profile_values Nmbr INNER JOIN users u ON u.uid = Nmbr.uid INNER JOIN profile_values Name ON Name.uid = u.uid WHERE Name.fid = 1 AND Nmbr.fid = 11 AND Nmbr.value != '' AND (Name.value!='Retiree' OR Nmbr.value = '1') ORDER BY Name.value "); print "<div><ol>"; foreach($res as $row_key => $row_val){ foreach($row_val as $thisRow){ print_r($thisRow); // print "<li>".$row_val['Name_Value']."</li>"; // print "<li>".$row_val['Nmbr_Value']."</li>"; } } print "</ol></div>"; } EDIT: the print_r($thisRow) does show the data, but it's not practical of course.
  8. I was just trying mysqli and a simple foreach loop, and trying E.g. $data['Nmbr_Value'] , $data['Name_Value'].
  9. the following SQL returns the data I need, but I don't know how to access it as I need with PHP. Using this free little app I can demo that the data can be used as I want, but it produces files dependent upon much more library code than I need (of course). I simply want to access the row values from two separate table alias columns, Name_value and Nmbr_value, as shown in the img. SELECT DISTINCT Nmbr.uid as Nmbr_uid, Nmbr.fid as Nmbr_fid, Nmbr.value as Nmbr_value, Name.fid as Name_fid, Name.value as Name_Value, u.uid as u_uid, u.status as u_status, Name.uid as Name_uid FROM profile_values Nmbr INNER JOIN users u ON u.uid = Nmbr.uid INNER JOIN profile_values Name ON Name.uid = u.uid WHERE Name.fid = 1 AND Nmbr.fid = 11 AND Nmbr.value != '' AND (Name.value!='Retiree' OR Nmbr.value = '1') ORDER BY Name.value DESC I've heard this type of SQL query referred to as a "SELF JOIN". In any case, I don't know how to iterate over this type of result set so I can use it e.g. to create HTML forms, etc. Thank you!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.